Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After updating the Document in spring ai core, I encountered the following problem #1968

Open
MusicBoooox opened this issue Dec 18, 2024 · 0 comments

Comments

@MusicBoooox
Copy link

MusicBoooox commented Dec 18, 2024

This is my code:

   Resource resource = new FileSystemResource(filePath);
    List<Document> documents = new TikaDocumentReader(resource).read();
    return new TokenTextSplitter(knowledgeBaseFileSlice.getDefaultChunkSize(), 
            knowledgeBaseFileSlice.getMinChunkSizeChars(),
            knowledgeBaseFileSlice.getMinChunkLengthToEmbed(), knowledgeBaseFileSlice.getMaxNumChunks(),
            knowledgeBaseFileSlice.isKeepSeparator()).apply(documents);

After TikaDocumentReader reads a Word document, the content read not only includes the text of the document, but also the XML information of the file, if I use getText(), the output will include the following content, like this:
docProps/app.xml
Normal.dotm 1 0 0 0 0 0 false false 0 WPS Office_10.1.0.7698_F1E327BC-269C-435d-A152-05C5408002CA 0

docProps/core.xml
2023-08-26T18:18:00Z admin admin 2023-08-26T18:18:41Z 1

docProps/custom.xml
2052-10.1.0.7698

word/styles.xml

word/settings.xml

word/theme/theme1.xml

word/document.xml

What went wrong???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant