Class TermKeywordExtractor
- java.lang.Object
-
- com.gengoai.hermes.extraction.keyword.TermKeywordExtractor
-
- All Implemented Interfaces:
Extractor
,KeywordExtractor
,Serializable
public class TermKeywordExtractor extends Object implements KeywordExtractor
Implementation of a
KeywordExtractor
that extracts and scores terms based on a givenFeaturizingExtractor
*.- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TermKeywordExtractor()
Instantiates a new TermSpec keyword extractor that uses a default TermSpec with lowercase wordsTermKeywordExtractor(@NonNull FeaturizingExtractor termExtractor)
Instantiates a new TermSpec keyword extractor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Extraction
extract(@NonNull HString hString)
Generate anExtraction
from the givenHString
.void
fit(DocumentCollection corpus)
In certain cases a keyword extractor needs to collect corpus level statistics or construct a model of what a good keyword looks like.
-
-
-
Constructor Detail
-
TermKeywordExtractor
public TermKeywordExtractor()
Instantiates a new TermSpec keyword extractor that uses a default TermSpec with lowercase words
-
TermKeywordExtractor
public TermKeywordExtractor(@NonNull @NonNull FeaturizingExtractor termExtractor)
Instantiates a new TermSpec keyword extractor.- Parameters:
termExtractor
- the specification on how to extract terms
-
-
Method Detail
-
extract
public Extraction extract(@NonNull @NonNull HString hString)
Description copied from interface:Extractor
Generate anExtraction
from the givenHString
.
-
fit
public void fit(DocumentCollection corpus)
Description copied from interface:KeywordExtractor
In certain cases a keyword extractor needs to collect corpus level statistics or construct a model of what a good keyword looks like. The fit method allows implementations to perform this logic at a corpus level.- Specified by:
fit
in interfaceKeywordExtractor
- Parameters:
corpus
- the corpus to fit the extractor to
-
-