问题
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