I have several plain text docx files. After being cleaned by dify, only a small amount of text was read and a lot of text was lost. #5288

Closed
opened 2026-02-21 18:10:16 -05:00 by yindo · 1 comment
Owner

Originally created by @PsycheJ on GitHub (Aug 28, 2024).

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

I have several plain text docx files. After being cleaned by dify, only a small amount of text was read and a lot of text was lost.I remember it was fully readable in earlier versions of dify.
1、行政处罚案件档案整理规则.docx
QQ截图20240829111255
QQ截图20240829111305

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @PsycheJ on GitHub (Aug 28, 2024). ### Self Checks - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. I have several plain text docx files. After being cleaned by dify, only a small amount of text was read and a lot of text was lost.I remember it was fully readable in earlier versions of dify. [1、行政处罚案件档案整理规则.docx](https://github.com/user-attachments/files/16791400/1.docx) ![QQ截图20240829111255](https://github.com/user-attachments/assets/6cf2b3e3-5e86-4831-a18c-2dc36686b868) ![QQ截图20240829111305](https://github.com/user-attachments/assets/ad1171cf-0386-45c1-97b9-c6e3efa6e7f1) ### 2. Additional context or comments _No response_ ### 3. Can you help us with this feature? - [ ] I am interested in contributing to this feature.
yindo added the 🐞 bug label 2026-02-21 18:10:16 -05:00
yindo closed this issue 2026-02-21 18:10:16 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 28, 2024):

A lot of text may be lost when cleaning plain text DOCX files with Dify due to the preprocessing rules applied during the cleaning process. Specifically, the rules for replacing continuous spaces, newlines, and tabs, as well as deleting all URLs and email addresses, can result in significant text loss if not configured properly.

Supporting evidence from the document:

Preprocessing rules:

  • Replace continuous spaces, newlines, and tabs;
  • Delete all URLs and email addresses;

Additionally, the CleanProcessor class in Dify's codebase shows that during the extraction and transformation phases, text documents are cleaned and split according to the processing rules. This includes removing extra spaces, URLs, and emails, which can inadvertently remove or alter significant portions of the text, leading to the observed loss of content [1][2][3].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Aug 28, 2024): <!-- Answer --> A lot of text may be lost when cleaning plain text DOCX files with Dify due to the preprocessing rules applied during the cleaning process. Specifically, the rules for replacing continuous spaces, newlines, and tabs, as well as deleting all URLs and email addresses, can result in significant text loss if not configured properly. Supporting evidence from the document: > **Preprocessing rules:** > > * Replace continuous spaces, newlines, and tabs; > * Delete all URLs and email addresses; Additionally, the `CleanProcessor` class in Dify's codebase shows that during the extraction and transformation phases, text documents are cleaned and split according to the processing rules. This includes removing extra spaces, URLs, and emails, which can inadvertently remove or alter significant portions of the text, leading to the observed loss of content <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/guides/knowledge-base/create-knowledge-and-upload-documents.md)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/api/core/indexing_runner.py)</sup><sup>[[3]](https://github.com/langgenius/dify/blob/main/api/core/rag/cleaner/clean_processor.py)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#5288