자동 텍스트 축약 절은 automatic text summarization에 관심이있는 것 같습니다
. 문제의 개요, 관련 문제 및 사용 가능한 알고리즘에 대해서는 Das 및 Martin의 논문 A Survey on Automatic Text Summarization (2007)을 살펴보십시오.
간단한 알고리즘
간단하지만 상당히 효과적인 요약 알고리즘은 즉, 가장 빈번한 사람이 stop list 단어를 포함하지 않는 가장 빈번한 콘텐츠 단어가 포함 된 원본 텍스트 (에서 문장의 제한된 수를 선택하는 것입니다).
Summarizer(originalText, maxSummarySize):
// start with the raw freqs, e.g. [(10,'the'), (3,'language'), (8,'code')...]
wordFrequences = getWordCounts(originalText)
// filter, e.g. [(3, 'language'), (8, 'code')...]
contentWordFrequences = filtStopWords(wordFrequences)
// sort by freq & drop counts, e.g. ['code', 'language'...]
contentWordsSortbyFreq = sortByFreqThenDropFreq(contentWordFrequences)
// Split Sentences
sentences = getSentences(originalText)
// Select up to maxSummarySize sentences
setSummarySentences = {}
foreach word in contentWordsSortbyFreq:
firstMatchingSentence = search(sentences, word)
setSummarySentences.add(firstMatchingSentence)
if setSummarySentences.size() = maxSummarySize:
break
// construct summary out of select sentences, preserving original ordering
summary = ""
foreach sentence in sentences:
if sentence in setSummarySentences:
summary = summary + " " + sentence
return summary
이 알고리즘을 사용하여 요약을 일부 오픈 소스 패키지
은 다음과 같습니다
Classifier4J (자바)
자바를 사용하는 경우, 당신은 Classifier4J의 모듈 SimpleSummarizer를 사용할 수 있습니다.
Classifier4J 텍스트 작업을위한 자바 패키지입니다 : 예를 사용
이의 원래 텍스트가 있다고 가정하자 here을 발견했다. Classifier4J는 summariser를 포함합니다. Summariser는 텍스트 요약을 허용합니다. Summariser 정말 멋지 네요. 나는 다른 java summarisers가 있다고 생각하지 않는다. 다음 코드에서 볼 수 있듯이
, 당신은 쉽게 간단한 한 문장으로 요약 만들 수 있습니다 위의 알고리즘을 사용하여
// Request a 1 sentence summary
String summary = summariser.summarise(longOriginalText, 1);
을,이 Classifier4J includes a summariser.
를 생성합니다.
NClassifier (C#을)
당신은 C#을 사용하는 경우, C 번호에 Classifier4J의 포트가있다라는 NClassifier
NLTK에 대한 트리스탄 Havelick의 요약 자 (파이썬)
거기 work-in-progress Python의 Natural Language Toolkit (NLTK)here을 사용할 수있는 Classifier4J 요약 자의 Python 포트.
가능한 중복 항목 : ** [C# 검색 결과 표시 관련 관련 문서 스 니펫 찾기] (http : // stackoverflow.com/questions/282002) ** – hippietrail