How to use Open Text Summarizer API?

空扰寡人 提交于 2020-01-12 05:44:06

问题


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


回答1:


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.


来源:https://stackoverflow.com/questions/21850963/how-to-use-open-text-summarizer-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!