Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Open Text Summarizer API?

I'm currently building a system, which will summarize a article from a webpage like Wikipedia.

I'm able to extract texts from web pages, and I know that the Open Text Summarizer API can help me to do summarization, but the problem is I don't know how to use it properly.

Please anyone who happen to know how to use this library? Can you provide a simple example for me? Currently I'm doing my project in C#.

like image 791
Alex Chu Avatar asked Oct 02 '22 13:10

Alex Chu


1 Answers

There is a lot of examples in codeplex. Did you read it ?

Well, here a sample from the Winform demo :

SummarizerArguments sumargs = new SummarizerArguments
                                          {
                                              DictionaryLanguage = "en",
                                              DisplayLines = sentCount,
                                              DisplayPercent = 0,
                                              InputFile = "",
                                              InputString = OriginalTextBox.Text // here your text
                                          };
SummarizedDocument doc = Summarizer.Summarize(sumargs);
string summary = string.Join("\r\n\r\n", doc.Sentences.ToArray());
// do some stuff with summary. It is your result.
like image 50
aloisdg Avatar answered Oct 05 '22 11:10

aloisdg