rename get_txt to get_text (#2649)

### What problem does this PR solve?



### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu
2024-09-29 12:47:09 +08:00
committed by GitHub
parent fb694143ee
commit fc867cb959
6 changed files with 13 additions and 12 deletions

View File

@ -17,7 +17,7 @@ from io import BytesIO
from docx import Document
from api.db import ParserType
from deepdoc.parser.utils import get_txt
from deepdoc.parser.utils import get_text
from rag.nlp import bullets_category, is_english, tokenize, remove_contents_table, hierarchical_merge, \
make_colon_as_title, add_positions, tokenize_chunks, find_codec, docx_question_level
from rag.nlp import rag_tokenizer
@ -166,7 +166,7 @@ def chunk(filename, binary=None, from_page=0, to_page=100000,
elif re.search(r"\.txt$", filename, re.IGNORECASE):
callback(0.1, "Start to parse.")
txt = get_txt(filename, binary)
txt = get_text(filename, binary)
sections = txt.split("\n")
sections = [l for l in sections if l]
callback(0.8, "Finish parsing.")