Search code examples
c#summarizationlibots

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#.


Solution

  • 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.