Method and system for positioning text coordinates and realizing pdf highlight by mask layer

By preprocessing data and storing vector databases on PDF files, combining large language model retrieval and mask layer highlighting technology, the problem of text coordinate positioning and highlighting implementation of PDF files in the existing technology is solved, and the user's quick search ability when applying large language model retrieval is realized, and the accuracy of highlighted content search is improved.

CN119962481AInactive Publication Date: 2025-05-09北京网藤科技有限公司

Patent Information

Application Number
CN202510447840.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-10
Publication Date
2025-05-09
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing PDF file processing technology cannot effectively realize text coordinate positioning and mask layer highlighting, which makes it difficult for users to quickly find relevant knowledge when applying large language models to search for PDF files.

Method used

By pre-processing the data of the PDF file, including OCR technology conversion, interference information deletion and separate processing of tables, images, and formulas, the text and coordinate data are read and segmented, and stored in a vector database. Then, the relevant text data is retrieved based on the large language model, the file name, page number and coordinate data are obtained, and the file name, page number and coordinate data are passed to the front end, and the mask layer is used to achieve highlighting.

Benefits of technology

It realizes that when searching PDF files in large language models, users can quickly find relevant knowledge, improve the accuracy of page highlighting content search, and meet the complex needs of PDF files highlighting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119962481A_ABST
    Figure CN119962481A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a system for positioning text coordinates and realizing pdf highlighting by a mask layer, and relates to the field of pdf file processing. The method specifically comprises the following steps: preprocessing a plurality of pdf files; traversing and reading characters and coordinate data of each file according to page numbers; segmenting the text by adopting a plurality of text line segmentation strategies to obtain a plurality of lines of texts; splicing a plurality of lines of texts into a text block, and performing combined calculation on coordinate data of each line of text data; storing the processed text data and the corresponding coordinate data into a vector database; retrieving related text data according to the problem, obtaining corresponding file name, page number and coordinate data, and transmitting the file name, page number and coordinate data to a preview page at the front end; traversing whether key sentences are included or not according to each page number; traversing the coordinate data of the page containing the key sentences; and creating a highlight mask layer for each key sentence. When pdf file retrieval is carried out by applying a large language model, a user can conveniently check corresponding recall knowledge.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of PDF file processing, and in particular to a method and system for text coordinate positioning and mask layer implementation of PDF highlighting. Background Art

[0002] In recent years, the fields related to big models have shown a rapid growth trend, and there are more and more big model-related applications. Among them, the applications realized through RAG retrieval enhancement account for the largest proportion. The RAG solution mainly enhances the big model by retrieving relevant field knowledge. It is particularly important to see the relevant documents recalled by the retrieval and make the answer content correspond to the relevant source. At present, the mainstream web-based PDF plug-ins basically match and highlight through text, and cannot achieve multi-text highlighting. Due to various factors such as text encoding, fonts, and typesetting in PDF, content recognition and positioning are very complicated. The traditional text matching highlighting cannot meet the needs well, and the matching accuracy is relatively low. In many cases, all or part of the matching will fail. Therefore, we need to propose a new method to realize PDF highlighting, which can facilitate users to view the corresponding recalled knowledge when applying large language models for PDF file retrieval. Summary of the invention

[0003] The technical problem to be solved by the present invention is how to facilitate users to view the corresponding recalled knowledge when applying a large language model to retrieve PDF files. The purpose is to provide a method and system for text coordinate positioning and mask layer to achieve PDF highlighting, which solves the above technical problems.

[0004] The present invention is achieved through the following technical solutions:

[0005] A method for realizing PDF highlighting by using text coordinate positioning and mask layer, comprising:

[0006] Perform data preprocessing on several PDF files;

[0007] Read the text and coordinate data of each of the above pdf files according to the page number;

[0008] Use a variety of preset text line segmentation strategies to segment the text to obtain multiple lines of text data;

[0009] Based on a preset text segmentation strategy, multiple lines of text data are spliced ​​into text blocks, and the coordinate data of each line of text data is combined and calculated; the processed text data and the corresponding coordinate data are stored in a vector database;

[0010] When answering questions based on the large language model, the relevant text data of the above-mentioned PDF file is retrieved according to the question, and the corresponding file name, page number and coordinate data are obtained and passed to the PDF preview page of the front end;

[0011] Traverse each page number of the PDF file to check whether the page contains a key sentence; traverse each coordinate data of the page containing the key sentence; create a highlight mask layer for each key sentence.

[0012] The above data preprocessing for several PDF files includes:

[0013] Perform data processing on several PDF files;

[0014] Convert PDF files to editable PDF format through OCR technology;

[0015] Identify and remove distracting information from PDF files;

[0016] Extract table data, images and formulas from PDF files for separate processing.

[0017] The above-mentioned reading of text and coordinate data of each of the above-mentioned PDF files according to page numbers includes: reading the text and coordinate data of each of the above-mentioned PDF files according to page numbers through pdfplumbe; judging whether there is an abnormality in the above-mentioned coordinate data based on preset abnormality rules; when an abnormality exists, using a PDF auxiliary parsing library to extract the above-mentioned coordinate data for supplementation.

[0018] The above-mentioned determination of whether the above-mentioned coordinate data is abnormal based on the preset abnormality rule includes:

[0019] Check whether the extracted coordinate data has abnormal values;

[0020] For the text block of the same paragraph, the above coordinate data is extracted multiple times, and the deviation between the multiple extraction results is calculated to determine abnormalities.

[0021] The above-mentioned preset multiple text line segmentation strategies are used to segment the text to obtain multiple lines of text data, including:

[0022] Formulate branch rules according to text format characteristics to divide text into lines;

[0023] Use machine learning algorithms to cluster text and get text lines;

[0024] Combine the above branching rules and the above machine learning algorithm to perform text branching.

[0025] The front end obtains the above-mentioned PDF preview page through the paging loading technology; and uses the virtual scrolling technology to render the above-mentioned mask layer within the current window range of the above-mentioned PDF preview page.

[0026] The highlight processing of the mask layer includes: setting the ID, size, position and color of the mask layer.

[0027] The above-mentioned method of realizing PDF highlighting by using text coordinate positioning and mask layer also includes: adding previous source and next source buttons to the current page, and locating to the key sentence of the previous or next item when the user clicks.

[0028] The above-mentioned method of realizing PDF highlighting by using text coordinate positioning and mask layer also includes: when the user zooms in, zooms out, or scrolls the above-mentioned PDF preview page, the above-mentioned PDF preview page is triggered to be updated, and the above-mentioned mask layer is added again after the update.

[0029] A system for realizing PDF highlighting by using text coordinate positioning and mask layer, comprising:

[0030] PDF file data preprocessing module: perform data preprocessing on several PDF files;

[0031] PDF file page number traversal module: read the text and coordinate data of each of the above PDF files according to the page number traversal;

[0032] PDF file text line segmentation module: uses multiple preset text line segmentation strategies to segment the text to obtain multiple lines of text data;

[0033] PDF file text segmentation module: splices multiple lines of text data into text blocks based on the preset text segmentation strategy, and performs combined calculation on the above coordinate data of each line of text data; stores the processed text data and the corresponding coordinate data into the vector database;

[0034] PDF file text line segmentation module: When answering questions based on a large language model, relevant text data is retrieved based on the index related to the question, and the corresponding file name, page number and coordinate information are obtained and passed to the PDF preview page on the front end;

[0035] PDF file highlight preview module: traverse each page number of the PDF file to check whether the page contains the key sentence; traverse each coordinate data of the page containing the key sentence; create a highlight mask layer for each coordinate data.

[0036] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0037] The present invention provides a method for text coordinate positioning and mask layer to realize PDF highlighting, comprising:

[0038] Data preprocessing is performed on several PDF files, so that the text and coordinate data of each PDF file are read by traversing according to the page number; after the text is segmented to obtain multiple lines of text data, the multiple lines of text data are spliced ​​into text blocks, and the coordinate data of each line of text data is combined and calculated; the processed text data and the corresponding coordinate data are stored in a vector database, so that when answering questions based on a large language model, the relevant text data of the PDF file is retrieved according to the question, and the corresponding file name, page number and coordinate data are obtained and passed to the PDF preview page of the front end, which is convenient for users to find and trace the source when applying the large language model retrieval; traverse according to each page number of the PDF file to check whether the page contains a key sentence; traverse each coordinate data of the page containing the key sentence; create a mask layer for highlighting for each key sentence, so as to facilitate and quickly find relevant data for users to view. The present invention can facilitate users to view corresponding recall knowledge when applying a large language model to retrieve PDF files, has a wide range of application prospects, and can greatly improve the accuracy of page highlight content search. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without creative work. In the drawings:

[0040] Figure 1 The present invention is a flowchart of a method for realizing PDF highlighting through text coordinate positioning and mask layer in an embodiment of the present application. DETAILED DESCRIPTION

[0041] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments and drawings. The exemplary embodiments of the present invention and their description are only used to explain the present invention and are not intended to limit the present invention.

[0042] Example

[0043] like Figure 1 As shown, the embodiment of the present application provides a method for text coordinate positioning and mask layer to realize PDF highlighting, including:

[0044] Perform data preprocessing on several PDF files;

[0045] Read the text and coordinate data of each of the above pdf files according to the page number;

[0046] Use a variety of preset text line segmentation strategies to segment the text to obtain multiple lines of text data;

[0047] The multi-line text data is spliced into text blocks based on a preset text chunking strategy, and the above coordinate data of each line of text data is combined and calculated; the processed text data and the corresponding coordinate data are stored in a vector database.

[0048] When answering questions based on a large language model, relevant text data of the above PDF file is retrieved according to the question, and the corresponding file name, page number, and coordinate data are obtained and passed to the PDF preview page of the front end.

[0049] Traverse each page of the PDF file to check whether the page contains a key sentence; traverse each coordinate data of the page containing the key sentence; create a highlighting mask layer for each key sentence.

[0050] The scanned PDF is converted into a text-searchable PDF through text recognition technology (OCR technology). The page can be cropped by the crop method of pdfplumber, or interference information can be recognized and deleted by methods such as regular expressions. It is mainly achieved through the following two methods: 1. Crop the page by the crop method of pdfplumber, and the interference information removed is other interference areas such as headers and footers. Among them, the crop method is one of the cropping functions. 2. Identify and delete specific text matched by multiple regular expressions. The interference information deleted includes meaningless data such as page numbers, watermarks, and timestamps. 3. Extract table data through the extract_table method of pdfplumber and process it separately. 4. Identify images and formulas through the extract_images and extract_words methods of pdfplumber and process them separately.

[0051] Specifically, multiple regular expressions can be expressed as follows: 1. Matching page numbers: \s*Page\s*\d+\s*|\s*第\s*\d+\s*页\s*|\s*\d+\s* / \s*\d+\s*. 2. Matching watermark information: (?i)(confidential|draft|forinternal use only|company name). 3. Matching timestamps:

[0052] (\d{4}[- / ]\d{2}[- / ]\d{2})|(\d{2}[- / ]\d{2}[- / ]\d{4})|(\d{2}:\d{2}:\d{2}). 4. Matching specific company logos: (?i)(©\s?\d{4}\s?Company Name\.?\s?All rightsreserved\.)|(Company Name).

[0053] For highlight content, the following methods are used: 1. Traverse each page number data to check whether the page contains the content to be highlighted. 2. For pages containing highlighted content, further traverse each coordinate data. 3. Create a div mask layer for each coordinate data and set the div's ID, size, position and color.

[0054] The specific implementation process is as follows: first, provide the knowledge base as the original pdf file data preparation; read and segment the knowledge base pdf file data, and obtain the file name, page number and coordinate information at the same time. Vectorize the knowledge base segmentation data and page number coordinates and other information, and write them into the vector database. When applied to the RAG system, the page number coordinate data corresponding to the knowledge index recalled from the vector knowledge base can be passed to the front end. The front end uses a mask layer to achieve highlighting and display optimization based on the page number and coordinate data. Among them, the coordinate data can obtain the position of the corresponding content of the text data by the range of paragraphs, lines and words.

[0055] The above data preprocessing for several PDF files includes:

[0056] Perform data processing on several PDF files;

[0057] Convert PDF files to editable PDF format through OCR technology;

[0058] Identify and remove distracting information from PDF files;

[0059] Extract table data, images and formulas from PDF files for separate processing.

[0060] The above-mentioned reading of text and coordinate data of each of the above-mentioned PDF files according to page numbers includes: reading the text and coordinate data of each of the above-mentioned PDF files according to page numbers through pdfplumbe; judging whether there is an abnormality in the above-mentioned coordinate data based on preset abnormality rules; when an abnormality exists, using a PDF auxiliary parsing library to extract the above-mentioned coordinate data for supplementation.

[0061] The above-mentioned determination of whether the above-mentioned coordinate data is abnormal based on the preset abnormality rule includes:

[0062] Check whether the extracted coordinate data has abnormal values;

[0063] For the text block of the same paragraph, the above coordinate data is extracted multiple times, and the deviation between the multiple extraction results is calculated to determine abnormalities.

[0064] In the data preparation stage, several PDF files are processed and processed in advance. The PDF text is read through the pdfplumber library, and the page number is traversed and read, and the coordinate data of each line is read. In order to solve the accuracy problem of the coordinate data extracted by the pdfplumber library, especially in the case of complex typesetting, font changes, text rotation, etc., other PDF parsing libraries are used to assist in obtaining coordinates when the coordinate data is abnormal based on the rule. For example, PyMuPDF, Camelot, etc.) extract the coordinate data of the same content for supplementation. Because the specific implementation methods of different PDF parsing libraries are different, the recognition effect of some special characters is different. Pdfplumber can extract text, tables and images, but for complex PDF files, the extraction effect is not ideal, and in some cases, the table data cannot be recognized. PyMuPDF has powerful performance and fast speed, which is suitable for scenarios that require efficient processing, especially PDF documents that need to process images and annotations. Camelot is specially used to extract tables from PDF files and can process different types of tables, but it is only suitable for table extraction and does not support other types of PDF content extraction. For complex scenarios such as PDF documents with images, tables, and annotations, the accuracy is improved by combining the characteristics of different parsing libraries. After the improvement, multiple parsing libraries are comprehensively compared and verified to improve the recognition accuracy.

[0065] Examples of abnormal judgment rules are as follows: 1. Check whether the extracted coordinate data has obvious abnormal values, such as too large, too small, negative values, etc.; for example, the vertical coordinate suddenly changes from 200 to 20 on the same page, and the value that should increase suddenly decreases; for example, the value displayed is not negative, which are all abnormal situations. 2. For the text blocks of the same paragraph, run pdfplumber multiple times to extract coordinate data, and calculate the deviation between each extraction result. Among them, it mainly includes comparing and judging the starting position and ending position coordinates of the coordinates. Each subsequent extraction is calculated with the first extraction coordinates, and a difference is obtained and recorded. Finally, the difference that appears the most times in the record can be taken out, and the difference size can be judged based on actual experience to determine whether it is large and whether it is abnormal.

[0066] The above-mentioned preset multiple text line segmentation strategies are used to segment the text to obtain multiple lines of text data, including:

[0067] Formulate branch rules according to text format characteristics to divide text into lines;

[0068] Use machine learning algorithms to cluster text and get text lines;

[0069] Combine the above branching rules and the above machine learning algorithm to perform text branching.

[0070] The text is segmented through different text segmentation algorithms. There are the following strategies for text segmentation: 1. Rule-based segmentation: Rules are formulated according to the format characteristics of the text (such as indentation, blank lines, font changes, etc.) to segment the text into different blocks. There are many specific rule-based segmentation strategies, and here are a few: 1. Standard legal and regulatory documents. For example, the basic form of legal and regulatory documents is "Article 1: xxxx Article 2: xxxx", so according to the line breaks and indentations of the paragraphs, combined with the regular expression "Article x", the rules are matched to complete the segmentation of each article into a text block. 2. Industry specification documents. The basic form of industry specification documents is "1.1 xxxx1.2 xxxx", so according to the line breaks and indentations of the paragraphs, combined with the regular expression "xx", the content rules are matched, so that each small point is segmented into a text block. There are other rule-based segmentation methods that can be customized according to the characteristics of the text. 2. Machine learning-based segmentation: Use machine learning algorithms (such as clustering algorithms) to cluster text and classify similar text lines into the same block. 3. Hybrid method: Combine rules and machine learning methods to segment text to improve accuracy. If the format of the text is relatively neat, choose rule-based segmentation. For example, standard legal and regulatory documents can be segmented according to each rule. Otherwise, choose to use a machine learning algorithm for text classification. If the verification effect is poor after the classification is completed, add some rules to customize the segmentation algorithm to optimize the effect. Among them, the machine learning algorithm, for example, uses the naive Bayes algorithm to perform binary classification on a sentence and the previous sentence and the next sentence to obtain the segmentation result.

[0071] The front end obtains the above-mentioned PDF preview page through the paging loading technology; and uses the virtual scrolling technology to render the above-mentioned mask layer within the current window range of the above-mentioned PDF preview page.

[0072] The highlight processing of the mask layer includes: setting the ID, size, position and color of the mask layer.

[0073] The above-mentioned method of realizing PDF highlighting by using text coordinate positioning and mask layer also includes: adding previous source and next source buttons to the current page, and locating to the key sentence of the previous or next item when the user clicks.

[0074] Based on the text segmentation strategy, multiple lines of data will be spliced ​​into one piece of knowledge, and the coordinate data of each line will be combined and calculated. Among them, the coordinate data will be re-counted according to each line of data after splicing. Finally, the segmented text data and the coordinate data corresponding to the text will be stored together in the vector database. When answering questions based on the large model of the RAG solution, the relevant knowledge data retrieved and recalled is first obtained, and the file name, page number and coordinate information corresponding to each indexed knowledge are passed to the front-end pdf highlight preview page. Text highlighting provides two modes: auto and custom. Among them, Custom: allows users to customize the highlighting display method, such as adjusting the color depth or transparency according to the score. Auto: Highlight different colors according to the relevance of the document recall, such as using yellow, blue, and green to represent high, medium and low relevance respectively.

[0075] First, use virtual scrolling technology. Virtual scrolling is an efficient rendering technology that improves performance by reducing the number of DOM elements rendered at one time on the page. When the user scrolls the table, virtual scrolling will only render the data in the current visible area instead of loading and rendering all the data at once. Render the mask layer only within the current window range to improve performance; for very large documents, use paging loading technology to avoid loading all pages at once. You can also use segmented loading and rendering to avoid performance problems caused by loading too large files at one time. Among them, the front end can use the pdf.js plug-in to load the pdf file and embed it into the page through an iframe. After the file is rendered, a custom event is triggered to notify the main thread that it can start processing the highlight mask layer.

[0076] The above-mentioned method of realizing PDF highlighting by using text coordinate positioning and mask layer also includes: when the user zooms in, zooms out, or scrolls the above-mentioned PDF preview page, the above-mentioned PDF preview page is triggered to be updated, and the above-mentioned mask layer is added again after the update.

[0077] In summary, the embodiment of the present application provides a method and system for realizing PDF highlighting by text coordinate positioning and mask layer, by preprocessing data of several PDF files, traversing and reading the text and coordinate data of each PDF file according to the page number; after segmenting the text to obtain multiple lines of text data, splicing the multiple lines of text data into text blocks, and combining and calculating the coordinate data of each line of text data; storing the processed text data and the corresponding coordinate data in a vector database, so that when answering questions based on a large language model, the relevant text data of the PDF file is retrieved according to the question, and the corresponding file name, page number and coordinate data are obtained and passed to the PDF preview page of the front end, so that the user can find the source when applying the large language model retrieval; traverse according to each page number of the PDF file to check whether the page contains a key sentence; traverse each coordinate data of the page containing the key sentence; create a mask layer for highlighting processing for each key sentence, so as to facilitate the rapid search of relevant data for users to view. The present invention can facilitate users to view the corresponding recall knowledge when applying the large language model to retrieve PDF files, has a wide range of application prospects, and can greatly improve the accuracy of page highlight content search.

[0078] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for realizing PDF highlighting by using text coordinate positioning and mask layer, characterized in that: include: Perform data preprocessing on several PDF files; Read the text and coordinate data of each pdf file according to the page number; Use a variety of preset text line segmentation strategies to segment the text to obtain multiple lines of text data; Based on a preset text segmentation strategy, multiple lines of text data are spliced ​​into text blocks, and the coordinate data of each line of text data is combined and calculated; the processed text data and the corresponding coordinate data are stored in a vector database; When answering questions based on the large language model, relevant text data of the PDF file is retrieved according to the question, and the corresponding file name, page number and coordinate data are obtained and passed to the PDF preview page of the front end; Traverse each page number of the PDF file to check whether the page contains a key sentence; traverse each coordinate data of the page containing the key sentence; create a highlight mask layer for each key sentence.

2. The method for realizing PDF highlighting by using text coordinate positioning and mask layer according to claim 1, characterized in that: The data preprocessing of the plurality of PDF files comprises: Perform data processing on several PDF files; Convert PDF files to editable PDF format through OCR technology; Identify and remove distracting information from PDF files; Extract table data, images and formulas from PDF files for separate processing.

3. The method for realizing PDF highlighting by using text coordinate positioning and mask layer according to claim 1, characterized in that: The method of traversing and reading the text and coordinate data of each PDF file according to the page number includes: reading the text and coordinate data of each PDF file according to the page number by using pdfplumbe; judging whether the coordinate data has an abnormality based on a preset abnormality rule; and when an abnormality exists, using a PDF auxiliary parsing library to extract the coordinate data for supplementation.

4. The method of realizing PDF highlighting by using text coordinate positioning and mask layer according to claim 3, characterized in that: The determining whether the coordinate data is abnormal based on a preset abnormality rule includes: Check whether the extracted coordinate data has abnormal values; For a text block in the same paragraph, the coordinate data is extracted multiple times, and the deviation between the multiple extraction results is calculated to determine abnormalities.

5. The method of realizing PDF highlighting by using text coordinate positioning and mask layer according to claim 1, characterized in that: The method of using a plurality of preset text line segmentation strategies to segment the text to obtain multiple lines of text data includes: Formulate branch rules according to text format characteristics to divide text into lines; Use machine learning algorithms to cluster text and get text lines; The text is divided into lines by combining the line division rule and the machine learning algorithm.

6. The method for realizing PDF highlighting by using text coordinate positioning and mask layer according to claim 1, characterized in that: Also includes: The front end obtains the pdf preview page through paging loading technology; The mask layer is rendered within the current window range of the PDF preview page using virtual scrolling technology.

7. The method of realizing PDF highlighting by using text coordinate positioning and mask layer according to claim 1, characterized in that: The highlight processing of the mask layer includes: setting the ID, size, position and color of the mask layer.

8. The method of realizing PDF highlighting by using text coordinate positioning and mask layer according to claim 1, characterized in that: Also includes: Add the previous source and next source buttons to the current page, and when the user clicks them, they will be directed to the previous or next key sentence.

9. The method of realizing PDF highlighting by using text coordinate positioning and mask layer according to claim 6, characterized in that: Also includes: When the user zooms in, zooms out, or scrolls the PDF preview page, the PDF preview page is triggered to be updated, and the mask layer is added again after the update.

10. A system for text coordinate positioning and mask layer to achieve PDF highlighting, characterized in that: include: PDF file data preprocessing module: perform data preprocessing on several PDF files; PDF file page number traversal module: read the text and coordinate data of each PDF file according to the page number traversal; PDF file text line segmentation module: uses multiple preset text line segmentation strategies to segment the text to obtain multiple lines of text data; PDF file text segmentation module: splices multiple lines of text data into text blocks based on a preset text segmentation strategy, and performs combined calculations on the coordinate data of each line of text data; stores the processed text data and the corresponding coordinate data into a vector database; PDF file text line segmentation module: When answering questions based on a large language model, relevant text data is retrieved based on the index related to the question, and the corresponding file name, page number and coordinate information are obtained and passed to the PDF preview page on the front end; PDF file highlight preview module: traverse each page number of the PDF file to check whether the page contains the key sentence; traverse each coordinate data of the page containing the key sentence; create a highlight mask layer for each coordinate data.

Citation Information

Patent Citations

  • Text semantic slicing method for retrieval enhancement generation

    CN117852549A

  • Question and answer processing method and device, storage medium and electronic equipment

    CN118428474A

  • Text checking front-end interaction method and system

    CN118798141A

  • Generating high-level questions from sentences

    US20160063879A1

Cited By

  • Knowledge processing method and system based on multi-dimensional semantic enhancement and storage medium

    CN122309765A