Class KeywordMetadataEnricher
java.lang.Object
org.springframework.ai.model.transformer.KeywordMetadataEnricher
Keyword extractor that uses generative to extract 'excerpt_keywords' metadata field.
- Author:
- Christian Tzolov, YunKui Lu
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionKeywordMetadataEnricher
(ChatModel chatModel, int keywordCount) Create a newKeywordMetadataEnricher
instance.KeywordMetadataEnricher
(ChatModel chatModel, PromptTemplate keywordsTemplate) Create a newKeywordMetadataEnricher
instance. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.ai.document.DocumentTransformer
transform
-
Field Details
-
CONTEXT_STR_PLACEHOLDER
- See Also:
-
KEYWORDS_TEMPLATE
- See Also:
-
EXCERPT_KEYWORDS_METADATA_KEY
- See Also:
-
-
Constructor Details
-
KeywordMetadataEnricher
Create a newKeywordMetadataEnricher
instance.- Parameters:
chatModel
- the model predictor to use for keyword extraction.keywordCount
- the number of keywords to extract.
-
KeywordMetadataEnricher
Create a newKeywordMetadataEnricher
instance.- Parameters:
chatModel
- the model predictor to use for keyword extraction.keywordsTemplate
- the prompt template to use for keyword extraction.
-
-
Method Details