from llama_index.extractors import (
MetadataExtractor,
QuestionsAnsweredExtractor,
TitleExtractor
)
from llama_index.text_splitter import TokenTextSplitter
from llama_index.node_parser import SimpleNodeParser
text_splitter = TokenTextSplitter(separator=" ", chunk_size=512, chunk_overlap=20)
metadata_extractor = MetadataExtractor(
extractors=[
TitleExtractor(nodes=5),
QuestionsAnsweredExtractor(questions=3),
],
)
node_parser = SimpleNodeParser(
text_splitter = text_splitter,
metadata_extractor=metadata_extractor
)
gives error
ImportError Traceback (most recent call last)
<ipython-input-9-29ea0ec25abc> in <cell line: 1>()
----> 1 from llama_index.extractors import (
2 MetadataExtractor,
3 QuestionsAnsweredExtractor,
4 TitleExtractor
5 )
ImportError: cannot import name 'MetadataExtractor' from 'llama_index.extractors' (/usr/local/lib/python3.10/dist-packages/llama_index/extractors/__init__.py)