compass.extraction.apply.extract_date#
- async extract_date(doc, model_config, usage_tracker=None)[source]#
Parse a single document for date information
- Parameters:
doc (
elm.web.document.BaseDocument) – A document potentially containing date information.model_config (
compass.llm.config.LLMConfig) – Configuration describing which LLM service, splitter, and call parameters should be used for date extraction.usage_tracker (
UsageTracker, optional) – Optional tracker instance to monitor token usage during LLM calls. By default,None.
- Returns:
elm.web.document.BaseDocument– Document that has been parsed for dates. The results of the parsing are stored in the documents attrs. In particular, the attrs will contain a"date"key that will contain the parsed date information.
Notes
Documents already containing a
"date"attribute are returned without reprocessing.