[go: up one dir, main page]

CN111681301A - Method, device, terminal and storage medium for processing pictures and texts in slides - Google Patents

Method, device, terminal and storage medium for processing pictures and texts in slides Download PDF

Info

Publication number
CN111681301A
CN111681301A CN202010512421.8A CN202010512421A CN111681301A CN 111681301 A CN111681301 A CN 111681301A CN 202010512421 A CN202010512421 A CN 202010512421A CN 111681301 A CN111681301 A CN 111681301A
Authority
CN
China
Prior art keywords
picture
text
slide
information
page
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010512421.8A
Other languages
Chinese (zh)
Other versions
CN111681301B (en
Inventor
余芳强
彭阳
张铭
黄轶
许璟琳
高尚
李晨辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Construction No 4 Group Co Ltd
Original Assignee
Shanghai Construction No 4 Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Construction No 4 Group Co Ltd filed Critical Shanghai Construction No 4 Group Co Ltd
Priority to CN202010512421.8A priority Critical patent/CN111681301B/en
Publication of CN111681301A publication Critical patent/CN111681301A/en
Application granted granted Critical
Publication of CN111681301B publication Critical patent/CN111681301B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • G06F16/5846Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using extracted text
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/211Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Library & Information Science (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Machine Translation (AREA)

Abstract

The invention discloses a method, a device, a terminal and a storage medium for processing pictures and texts in a slide, wherein the method comprises the following steps: determining picture information and text information of each page of slide in the slide file; carrying out natural language analysis processing on the text information of all the page slides to obtain named text sentences of all the page slides; matching named text sentences for each picture according to the picture information in the slide file and the named text sentences of the slide file; and establishing a corresponding relation between the picture information and the text information in the slide file according to the picture information in the slide file and the picture naming text sentence obtained by matching each picture. The scheme of the invention can solve the problem of higher difficulty in searching the corresponding relation between the plurality of pictures and the plurality of text information in each page of engineering slide, and achieves the effect of reducing the searching difficulty of the corresponding relation between the plurality of pictures and the plurality of text information in each page of engineering slide.

Description

Method, device, terminal and storage medium for processing pictures and texts in slides
Technical Field
The invention belongs to the technical field of information of construction engineering, and particularly relates to a method, a device, a terminal and a storage medium for processing pictures and texts in a slide, in particular to a method, a device, a terminal and a storage medium for automatically matching pictures and texts in a slide of construction engineering data, and automatically naming and separately storing the pictures.
Background
In the engineering construction management process, a large number of slides in formats such as PPT (Microsoft Office PowerPoint, which refers to Microsoft corporation's presentation software) are often used for communication and communication. These slides are important assets for the enterprise as high quality engineering material. The slides have a large number of precious pictures, which need to be viewed frequently in business, and can be reused in the subsequent document making process. Because the pictures are dispersedly stored in each slide file, the pictures are difficult to quickly retrieve in the using process, so that each slide file is often required to be manually opened for searching, and the efficiency is low. There is a need to find correspondences between multiple pictures and multiple text messages in each page of engineering slides to provide a more convenient way to view and use the engineering slides. The engineering slide has the characteristics of large quantity of pictures and more character information, which brings certain difficulty to processing, so that it is important to select a proper algorithm to find the corresponding relation between a plurality of pictures and a plurality of text information in each page of the engineering slide.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The present invention aims to solve the above-mentioned drawbacks and provide a method, an apparatus, a terminal and a storage medium for processing pictures and texts in a slide, so as to solve the problem of difficulty in finding the correspondence between multiple pictures and multiple text messages in each page of engineering slide, and achieve the effect of reducing the difficulty in finding the correspondence between multiple pictures and multiple text messages in each page of engineering slide.
The invention provides a method for processing pictures and texts in a slide, which comprises the following steps: determining picture information and text information of each page of slide in the slide file; carrying out natural language analysis processing on the text information of all page slides in the slide file to obtain named text sentences of all page slides in the slide file; matching a named text sentence for each picture in the slide file according to the picture information in the slide file and the named text sentence of the slide file to obtain a picture named text sentence of each picture; establishing a corresponding relation between the picture information and the text information in the slide file according to the picture information in the slide file and the picture naming text sentence obtained by matching each picture; the picture information of each page of slide in the slide file comprises: the width and height of each page of slide, and the picture bounding box information of each picture in each page of slide; text information for each slide in the slide file, including: the text content, font size, and/or text bounding box information of all text statements of each slide.
Optionally, wherein determining the picture information and the text information of each page of slide in the slide file comprises: aiming at each page of slide in the slide file, acquiring the width and height of each page of slide, and acquiring the picture bounding box information of each picture in each page of slide as the picture information of each page of slide in the slide file; acquiring text contents, word sizes and/or text bounding box information of all text sentences in each page of slide as text information of each page of slide in the slide file; and/or performing natural language analysis processing on the text information of all pages of slides in the slide file, wherein the natural language analysis processing comprises the following steps: determining each page of corpus information of each page of slides in the slide file and full text corpus information of all pages of slides in the slide file based on the text information of all pages of slides in the slide file; performing natural language analysis processing on each page of corpus information and full-text corpus information to obtain a subject word set and a trivial word set of each page of slide, and a full-text subject word set and a full-text trivial word set of all pages of slides; determining named file sentences of all text information in the slide file based on the subject word set and the trivial word set of each page of the slide, and the full-text subject word set and the full-text trivial word set of all pages of the slide; and/or establishing a corresponding relation between the picture information and the text information in the slide file, wherein the corresponding relation comprises the following steps: and naming a text sentence aiming at the picture of each picture in each page of slide in the slide file, constructing a storage result for each picture, and storing each picture according to the storage result.
Optionally, wherein determining corpus information of each page of each slide in the slide file and full-text corpus information of all pages of slides in the slide file comprises: connecting the text information of each page of slide in the slide file according to a first set sequence to form each page of corpus information of each page of slide; and eliminating the text information which repeatedly appears at the same position in different page slides aiming at the text information of all page slides in the slide file to obtain the corrected text information of all page slides; connecting the corrected text information of all the page slides according to a second set sequence to form full text corpus information of all the page slides; and/or performing natural language analysis processing on each page of corpus information and full-text corpus information, including: performing Chinese word segmentation processing on each page of corpus information and each corpus information in the full-text corpus information by using an N shortest path word segmentation algorithm to obtain word segmentation results; in the word segmentation result, the sentence in each corpus information is segmented into words and phrases with set specifications and set proper nouns to obtain segmented words; selecting a set number of words in the word segmentation result of each corpus according to a set score sequence by using a TextRank algorithm to serve as a subject word set of the corpus; classifying words in the corpus which meet the standard of trivial words (namely words which do not belong to the subject word set but have higher frequency than any subject word) into the trivial word set of the corpus; and/or determining named file statements of all text information in the slide file, including: determining the text content with the maximum word size in the part, in which the minimum Y-direction data in the text bounding box information of each picture in each page of slide is larger than the set coefficient times of the height of each picture, as the named text sentence of the picture in the page of slide according to the word size and the text bounding box information in the text information of each page of slide in the slide file; analogizing in sequence to obtain named text sentences of all pictures in all pages of slides in the slide file, wherein the named text sentences are used as named file sentences of all text information in the slide file; and/or, matching a named text statement for each picture in the slide file, including: determining all named text sentences of the picture in a set direction range according to the picture bounding box information in the picture information of each picture in each page of slide so as to obtain all named text sentences of the picture; if all named text sentences of the picture are empty, determining the named text sentences of the slide of the page where the picture is located as the named text sentences of the picture; if all the named text sentences of the picture are not empty, determining the weight according to all the named text sentences of the picture, and determining the matching result of the picture and all the named text sentences according to all the named text sentences of the picture; determining the named text sentence corresponding to the maximum one as the named text sentence matched with the picture according to the maximum one in the sum of the weight of the picture and the matching result of the picture, and taking the named text sentence as the picture named text sentence of the picture; and/or constructing a storage result for each picture, and storing each picture according to the storage result, wherein the method comprises the following steps: aiming at each page of slide, a folder is newly built and named by the named text sentence of the page of slide; independently storing each picture as an independent file, naming the independent file of each picture by using the picture naming text sentence of each picture, and then placing the independent file into the new folder; establishing a storage record for the picture in a database; and in the storage record of the picture, determining and storing the picture full name field of the picture according to the picture naming text sentence of the picture.
Optionally, wherein determining the weight according to all named text sentences of the picture includes: calculating the weight according to the word size of each named text sentence in all the named text sentences of the picture, the distance between each named text sentence of the picture and the central point of the picture and the overlapping length between each named text sentence of the picture and the picture
Figure BDA0002528793020000041
Wherein:
Figure BDA0002528793020000042
Figure BDA0002528793020000043
djis the distance between each named text sentence of the picture and the center point of the picture, ljThe overlapping length between each named text sentence of the picture and the picture is obtained; and/or determining the matching result of the picture and all named text sentences according to all named text sentences of the picture, wherein the matching result comprises the following steps: the word segmentation words in each named text sentence of the picture are sequentially carried out with the subject word set and the trivial word set of each page of the page where the picture is located, and the full text subject word set and the full text trivial word set of all the pages of the slideMatching to obtain a matching result; and/or determining and storing the picture full name field of the picture according to the picture naming text sentence of the picture, wherein the picture naming text sentence comprises the following steps: if the length of the Chinese character in the picture naming text sentence of the picture is less than or equal to a preset value, directly storing the picture naming text sentence of the picture as a picture full name field of the picture; if the length of the Chinese character in the picture naming text sentence of the picture is larger than a preset value, extracting a set phrase in the picture naming text sentence of the picture by using an information entropy algorithm, and taking the set phrase as a new picture naming text sentence of the picture; storing a new picture naming text statement of the picture as a picture full name field of the picture; determining the picture full name field of the picture as the search engine word segmentation of the picture by using a rapid word segmentation method, and storing the search engine word segmentation as the picture search word of the picture; and traversing all the pictures in the slide file, pairing a plurality of pictures with the same picture search word, and storing the paired pictures as similar pictures in a database.
In accordance with the above method, another aspect of the present invention provides an apparatus for processing pictures and texts in a slide, comprising: the determining unit is used for determining the picture information and the text information of each page of slide in the slide file; the processing unit is used for carrying out natural language analysis processing on the text information of all the page slides in the slide file to obtain named text sentences of all the page slides in the slide file; the processing unit is also used for matching a named text statement for each picture in the slide file according to the picture information in the slide file and the named text statement of the slide file to obtain a picture named text statement of each picture; the processing unit is also used for establishing a corresponding relation between the picture information and the text information in the slide file according to the picture information in the slide file and the picture naming text sentence obtained by matching each picture; the picture information of each page of slide in the slide file comprises: the width and height of each page of slide, and the picture bounding box information of each picture in each page of slide; text information for each slide in the slide file, including: the text content, font size, and/or text bounding box information of all text statements of each slide.
Optionally, wherein the determining unit determines the picture information and the text information of each page of the slide in the slide file, including: aiming at each page of slide in the slide file, acquiring the width and height of each page of slide, and acquiring the picture bounding box information of each picture in each page of slide as the picture information of each page of slide in the slide file; acquiring text contents, word sizes and/or text bounding box information of all text sentences in each page of slide as text information of each page of slide in the slide file; and/or the processing unit performs natural language analysis processing on the text information of all pages of slides in the slide file, and the processing unit comprises: determining each page of corpus information of each page of slides in the slide file and full text corpus information of all pages of slides in the slide file based on the text information of all pages of slides in the slide file; performing natural language analysis processing on each page of corpus information and full-text corpus information to obtain a subject word set and a trivial word set of each page of slide, and a full-text subject word set and a full-text trivial word set of all pages of slides; determining named file sentences of all text information in the slide file based on the subject word set and the trivial word set of each page of the slide, and the full-text subject word set and the full-text trivial word set of all pages of the slide; and/or the processing unit establishes a corresponding relation between the picture information and the text information in the slide file, and the corresponding relation comprises the following steps: and naming a text sentence aiming at the picture of each picture in each page of slide in the slide file, constructing a storage result for each picture, and storing each picture according to the storage result.
Optionally, wherein the processing unit determines each page corpus information of each page of slide in the slide file and full text corpus information of all pages of slides in the slide file, including: connecting the text information of each page of slide in the slide file according to a first set sequence to form each page of corpus information of each page of slide; and eliminating the text information which repeatedly appears at the same position in different page slides aiming at the text information of all page slides in the slide file to obtain the corrected text information of all page slides; connecting the corrected text information of all the page slides according to a second set sequence to form full text corpus information of all the page slides; and/or the processing unit carries out natural language analysis processing on each page of corpus information and full-text corpus information, and the processing unit comprises: performing Chinese word segmentation processing on each page of corpus information and each corpus information in the full-text corpus information by using an N shortest path word segmentation algorithm to obtain word segmentation results; in the word segmentation result, the sentence in each corpus information is segmented into words and phrases with set specifications and set proper nouns to obtain segmented words; selecting a set number of words in the word segmentation result of each corpus according to a set score sequence by using a TextRank algorithm to serve as a subject word set of the corpus; classifying words in the corpus which meet the standard of trivial words (namely words which do not belong to the subject word set but have higher frequency than any subject word) into the trivial word set of the corpus; and/or the processing unit determines named file statements of all text information in the slide file, including: determining the text content with the maximum word size in the part, in which the minimum Y-direction data in the text bounding box information of each picture in each page of slide is larger than the set coefficient times of the height of each picture, as the named text sentence of the picture in the page of slide according to the word size and the text bounding box information in the text information of each page of slide in the slide file; analogizing in sequence to obtain named text sentences of all pictures in all pages of slides in the slide file, wherein the named text sentences are used as named file sentences of all text information in the slide file; and/or the processing unit matches named text sentences for each picture in the slide file, and comprises the following steps: determining all named text sentences of the picture in a set direction range according to the picture bounding box information in the picture information of each picture in each page of slide so as to obtain all named text sentences of the picture; if all named text sentences of the picture are empty, determining the named text sentences of the slide of the page where the picture is located as the named text sentences of the picture; if all the named text sentences of the picture are not empty, determining the weight according to all the named text sentences of the picture, and determining the matching result of the picture and all the named text sentences according to all the named text sentences of the picture; determining the named text sentence corresponding to the maximum one as the named text sentence matched with the picture according to the maximum one in the sum of the weight of the picture and the matching result of the picture, and taking the named text sentence as the picture named text sentence of the picture; and/or the processing unit constructs a storage result for each picture and stores each picture according to the storage result, and the method comprises the following steps: aiming at each page of slide, a folder is newly built and named by the named text sentence of the page of slide; independently storing each picture as an independent file, naming the independent file of each picture by using the picture naming text sentence of each picture, and then placing the independent file into the new folder; establishing a storage record for the picture in a database; and in the storage record of the picture, determining and storing the picture full name field of the picture according to the picture naming text sentence of the picture.
Optionally, the determining, by the processing unit, weights according to all named text sentences of the picture includes: calculating the weight according to the word size of each named text sentence in all the named text sentences of the picture, the distance between each named text sentence of the picture and the central point of the picture and the overlapping length between each named text sentence of the picture and the picture
Figure BDA0002528793020000061
Wherein:
Figure BDA0002528793020000062
Figure BDA0002528793020000063
djis the distance between each named text sentence of the picture and the center point of the picture, ljIs the sheetThe overlapping length between each named text sentence of the picture and the picture; and/or the processing unit determines the matching result of the picture and all named text sentences according to all named text sentences of the picture, and the method comprises the following steps: matching the word segmentation words in each named text sentence of the picture with the subject word set and the trivial word set of each page of the page where the picture is located, and the full-text subject word set and the full-text trivial word set of all the pages of the slides in sequence to obtain a matching result; and/or the processing unit determines and stores the picture full name field of the picture according to the picture naming text sentence of the picture, and the processing unit comprises: if the length of the Chinese character in the picture naming text sentence of the picture is less than or equal to a preset value, directly storing the picture naming text sentence of the picture as a picture full name field of the picture; if the length of the Chinese character in the picture naming text sentence of the picture is larger than a preset value, extracting a set phrase in the picture naming text sentence of the picture by using an information entropy algorithm, and taking the set phrase as a new picture naming text sentence of the picture; storing a new picture naming text statement of the picture as a picture full name field of the picture; determining the picture full name field of the picture as the search engine word segmentation of the picture by using a rapid word segmentation method, and storing the search engine word segmentation as the picture search word of the picture; and traversing all the pictures in the slide file, pairing a plurality of pictures with the same picture search word, and storing the paired pictures as similar pictures in a database.
In accordance with the above apparatus, a further aspect of the present invention provides a terminal, including: the above-mentioned processing device for pictures and texts in a slide.
In accordance with the above method, a further aspect of the present invention provides a storage medium, where the storage medium includes a stored program, and when the program runs, the apparatus where the storage medium is located is controlled to execute the above method for processing pictures and texts in a slide.
In accordance with the above method, the present invention provides a processor for executing a program, wherein the program executes the above method for processing the pictures and texts in the slide show.
According to the scheme, the pictures and the texts in the construction project data slides are automatically matched, the corresponding relation between the multiple pictures and the multiple text information in each page of the project slides can be conveniently determined, the pictures are automatically named and independently stored, the pictures in the project data slides can be quickly and automatically extracted, named and independently stored, the precious project pictures can be quickly searched according to the picture names subsequently, and the use convenience is improved.
Furthermore, according to the characteristics of large quantity of pictures and more character information of the engineering slide file, the position relation and the text semantic relation between the pictures and the text blocks in the slide are automatically analyzed by adopting natural language processing, so that the matching and automatic naming of the pictures and the texts in the slide are realized, the corresponding relation between a plurality of pictures and a plurality of text information in each page of the engineering slide can be conveniently determined, and the rapid retrieval and the repeated use of the slide pictures can be supported.
Furthermore, according to the scheme of the invention, the position relation between the pictures and the text contents in each page of the slide is compared with the characteristics of randomness but strong correlation, and the pictures are accurately matched with the text blocks through an intelligent algorithm according to the geometric position information, so that the corresponding relation between a plurality of pictures and a plurality of text information in each page of the engineering slide can be conveniently determined, and the retrieval and the use of a user are facilitated.
Furthermore, according to the scheme of the invention, by aiming at the position relation between the pictures and the word contents in each page of the slide, the algorithm based on the text font size bounding box and the semantic score is adopted, the most relevant text can be accurately matched for each picture under the condition that the positions of the text blocks are changeable and a plurality of pictures exist, so that the corresponding relation between the plurality of pictures and the plurality of text information in each page of the engineering slide is quickly determined, and the retrieval and the use of a user are facilitated.
Furthermore, according to the scheme of the invention, by aiming at the position relation between the pictures and the text contents in each page of the slide, in the process of determining the corresponding relation between the multiple pictures and the multiple text information in each page of the engineering slide, the natural language analysis algorithms such as Chinese word segmentation and TextRank are adopted, so that the method can extract the proper nouns such as names of people and place names, can also extract the subject terms of longer sections, can correspond to the subjects of the slide, and has wider application range.
Therefore, according to the scheme of the invention, the position relation and the text semantic relation between the pictures and the text blocks in the slides are automatically analyzed by adopting natural language processing, and the corresponding relation between the multiple pictures and the multiple text information in each page of the engineering slides is determined, so that the matching and the automatic naming of the pictures and the texts in the slides are realized, the problem of high difficulty in searching the corresponding relation between the multiple pictures and the multiple text information in each page of the engineering slides is solved, and the effect of reducing the searching difficulty in searching the corresponding relation between the multiple pictures and the multiple text information in each page of the engineering slides is achieved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
FIG. 1 is a flowchart illustrating an embodiment of a method for processing pictures and texts in a slide show according to the present invention;
FIG. 2 is a flowchart illustrating an embodiment of determining picture information and text information of each page of a slide file according to the method of the present invention;
FIG. 3 is a flowchart illustrating an embodiment of a natural language parsing process for text information of all pages of slides in a slide file according to the method of the present invention;
FIG. 4 is a flowchart illustrating an embodiment of determining corpus information of each page of each slide in a slide file and full-text corpus information of all pages of slides in the slide file according to the method of the present invention;
FIG. 5 is a flowchart illustrating an embodiment of performing natural language parsing on each page of corpus information and full-text corpus information according to the method of the present invention;
FIG. 6 is a flowchart illustrating an embodiment of matching named text statements for each picture in a slide file according to the method of the present invention;
FIG. 7 is a flowchart illustrating an embodiment of constructing a storage result for each picture and storing each picture according to the storage result in the method of the present invention;
FIG. 8 is a flowchart illustrating an embodiment of determining and storing a picture full name field of a picture according to a picture naming text statement of the picture according to the method of the present invention;
FIG. 9 is a schematic structural diagram of an embodiment of an apparatus for processing pictures and texts in a slide show according to the present invention;
FIG. 10 is a flowchart illustrating a method for automatic matching of pictures and names of pictures in a slide show according to an embodiment of the terminal of the present invention;
FIG. 11 is a diagram illustrating an example of matching a picture naming text statement in a slide show according to an embodiment of the terminal of the present invention;
FIG. 12 is a flowchart illustrating a matching procedure of picture naming text statements according to an embodiment of the terminal of the present invention;
FIG. 13 is a diagram illustrating an example of automatic picture extraction and naming results in a slide show according to an embodiment of the terminal of the present invention;
FIG. 14 is a diagram illustrating the structure of the result set stored in the database according to an embodiment of the terminal of the present invention;
fig. 15 is a schematic structural diagram of an apparatus for automatically matching pictures and naming pictures in a slide of a terminal according to an embodiment of the present invention.
The reference numbers in the embodiments of the present invention are as follows, in combination with the accompanying drawings:
1-slide information extraction module; 2-text sentence preprocessing module; 3-a natural language analysis module; 4-slide name matching module; 5-picture name matching module; 6-a picture storage module; 102-a determination unit; 104-processing unit.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the specific embodiments of the present invention and the accompanying drawings. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
According to an embodiment of the present invention, a method for processing pictures and texts in a slide is provided, as shown in fig. 1, which is a schematic flow chart of an embodiment of the method of the present invention. The method for processing the pictures and texts in the slides can be mainly applied to the aspect of processing the pictures and texts in the project slide files (namely, the slides in the project materials), and the method for processing the pictures and texts in the project slide files can comprise steps S110 to S140.
At step S110, the picture information and text information of each slide page in the slide file are determined.
Alternatively, a specific process of determining the picture information and the text information of each page of slide in the slide file in step S110 can be seen in the following exemplary description.
Referring to the flowchart of fig. 2, a specific process of determining the picture information and the text information of each page of slide in the slide file in step S110 is further described, where the specific process includes: step S210 and step S220.
Step S210, for each page of slide in the slide file, obtaining the width and height of each page of slide, and obtaining the picture bounding box information of each picture in each page of slide as the picture information of each page of slide in the slide file. That is, the picture information of each slide in the slide file may include: the width and height of each slide, and the picture bounding box information for each picture in each slide. And the number of the first and second groups,
step S220, acquiring text contents, word sizes, and/or text bounding box information of all text sentences in each page of slide as text information of each page of slide in the slide file. That is, the text information of each slide in the slide file may include: the text content, font size, and/or text bounding box information of all text statements of each slide.
For example: reading each picture p in slide fileiIs recorded as P ═ Pi},pi={Ximin,Yimin,Ximax,Yimax}; reading the text content, word size and bounding box information of all text sentences in each page of the slide, and recording as T ═ T { (T)i},ti={ci,ximin,yimin,ximax,yimax}. E.g. for page k slide h in the slide filekObtaining a width of hxHeight of hyRead page k slide hkIn each picture piIs recorded as Pk={pi},pi={Ximin,Yimin,Ximax,Yimax}; read page k slide hkThe text content, word size and bounding box information of all the text sentences in the Chinese sentence are recorded as Tk={ti},ti={ci,si,ximin,yimin,ximax,yimax}. Wherein, ciFor text content, siIs the number, ximin、yimin、ximax、yimaxIs bounding box information, i.e., location information.
For example: can be directed to each page of slide h in the slide filekAs shown in FIG. 11, the width is h x210, height hy130. Reading each picture p thereiniIs recorded as P ═ Pi},pi={Ximin,Yimin,Ximax,Yimax}. For each page of slide h, reading the text content of all text sentences in the slide hAnd the font size and bounding box information, recorded as T ═ Ti},ti={ci,si,ximin,yimin,ximax,yimax}. As shown in fig. 11, there are four pictures P ═ { P ═ P1,p2,p3,p4},p1={5,30,55,90},p260, 40, 105, 80; there are 7 text sentences T ═ T1,t2,t3,t4,t5,t6,t7Where t is3-hospital use of' 24, 10, 102, 50, 108}, t { "hospital use of some chinese medicine", t4"serviceman workload and level assessment", 14, 10, 23, 50, 27}, t5{ "building weak link assessment", 14, 107, 47, 113, 77 }.
Thus, by first determining the picture information and text information of each page of slide in the slide file, the pictures and texts in the project slide file can be processed conveniently based on the picture information and text information of each page of slide.
At step S120, the text information of all the pages of slides in the slide file is subjected to natural language analysis processing, resulting in named text sentences of all the pages of slides in the slide file, so that the named text sentences of the slide file can be determined according to the text information in the slide file.
Alternatively, a specific procedure of performing the natural language analysis processing on the text information of all the page slides in the slide file in step S120 may be as follows.
Referring to the flowchart of fig. 3, a specific process of performing natural language analysis processing on the text information of all pages of slides in the slide file in step S120 is further described, where the specific process includes: step S310 to step S330.
Step S310, based on the text information of all the pages of slides in the slide file, determining the corpus information of each page of slides in the slide file and the full text corpus information of all the pages of slides in the slide file.
More optionally, the specific process of determining the corpus information of each page of slide in the slide file and the full-text corpus information of all pages of slides in the slide file based on the text information of all pages of slides in the slide file in step S310 may be as follows.
With reference to the flowchart of fig. 4 showing an embodiment of determining each page of corpus information of each page of slides in the slide file and the full-text corpus information of all pages of slides in the slide file in the method of the present invention, a specific process of determining each page of corpus information of each page of slides in the slide file and the full-text corpus information of all pages of slides in the slide file in step S310 is further described, which may include: step S410 and step S420.
Step S410, the text information of each page of slide in the slide file is connected according to a first set sequence to form each page of linguistic data information (such as page linguistic data W) of each page of slidek). And the number of the first and second groups,
step S420, text information which repeatedly appears at the same position in slides of different pages is removed according to the text information of all the slides of all the pages in the slide file, and corrected text information of all the slides of all the pages is obtained; and connecting the corrected text information of all the page slides according to a second set sequence to form full text corpus information (such as full text corpus W) of all the page slides0)。
For example: composing the text of the page k slide into a section according to the sequence from top to bottom and from left to right to form a page corpus Wk. Then according to the sequence of slide film pages, all page corpora are formed into full text corpora W0However, before the connection, the text sentences repeatedly appearing at the same position in different slides should be deleted to correct the text sentence set T of each slidek. As shown in FIG. 11, text t2Is the title name of the slide, and can be removed by repeatedly appearing in all slides. Text t1The chapter name can be repeatedly appeared at the same position in a plurality of slides before and after the slide, and can be deleted.
Therefore, the corpus information of each page of the slide in the slide file and the full-text corpus information of all pages of the slides in the slide file are determined based on the text information of all pages of the slides in the slide file, and each page of the slides and all the slides can be processed respectively, so that the comprehensiveness and the accuracy of processing the pictures and the texts in the engineering slide file can be guaranteed.
Step S320, performing natural language analysis on each page of corpus information and full-text corpus information by using a natural language analysis method to obtain a subject word set and a trivial word set of each page of slide, and a full-text subject word set and a full-text trivial word set of all pages of slides.
More optionally, the step S320 of performing natural language analysis processing on each page of corpus information and full-text corpus information by using a natural language analysis method may include: and respectively carrying out natural language analysis processing on each page of corpus information and full-text corpus information to obtain a subject word set and a trivial word set of each page of the slideshow, and a full-text subject word set and a full-text trivial word set of all pages of the slideshow. For example: respectively to page corpus (i.e. page corpus W)k) And slide file corpus (i.e., full text corpus W)0) Performing natural language analysis to obtain a subject word set E of each pagek={ek,iThe trivial word set C per pagek={ck,iFull text subject term set E0={e0,iSet of full-text trivial words C0={c0,i}. More specific processing procedures may be as follows:
performing natural language analysis processing on each page of corpus information and full-text corpus information to obtain a subject word set and a trivial word set of each page of a slide; and performing natural language analysis processing on each page of corpus information and full-text corpus information to obtain a full-text subject word set and a full-text trivial word set of all pages of slides. The process of performing natural language analysis processing on any corpus information of each page of corpus information and full-text corpus information may further specifically include the following process.
Referring to the schematic flow chart of an embodiment of performing natural language analysis processing on each page of corpus information and full-text corpus information in the method of the present invention shown in fig. 5, a specific process of performing natural language analysis processing on each page of corpus information and full-text corpus information in step S320 is further described, which may include: step S510 to step S530.
Step S510, Chinese word segmentation processing is carried out on each page of corpus information and each corpus information in the full-text corpus information by using an N shortest path word segmentation algorithm, and word segmentation results are obtained. In the word segmentation result, the sentence in each corpus information is segmented into words and phrases with set specifications and set proper nouns to obtain the word segmentation.
For example: and performing Chinese word segmentation operation on the speech by using an N shortest path word segmentation algorithm, and segmenting the sentence into short words, phrases and proper nouns. For example, "serviceman workload and proficiency rating" will be divided into { serviceman, personnel, workload, and, proficiency, rating }.
Step S520, using the TextRank algorithm to select a set number of words in the word segmentation result of each corpus according to a set score order, as a subject word set (e.g., a subject word set E) of the corpus.
For example: and selecting the 10 words with the highest scores as the subject word set E of the corpus by using a TextRank algorithm. These terms are characterized by high frequency of occurrence and strong association with other subject terms. For example, the topic word set E of case PPT is { repair, work order, hospital, … … }.
In step S530, words in the corpus that meet the trivial word criteria (i.e., words that do not belong to the topic word set but have a higher frequency than any topic word) are classified into the trivial word set (e.g., the trivial word set C) of the corpus.
For example: and classifying words which do not belong to the subject word set but have higher frequency than any subject word in the corpus into a trivial word set C. These trivial words are characterized by being used frequently in many different corpora, and therefore, they do not have a degree of identification, cannot be used as keywords in a particular corpus, and rather have a negative effect on semantic generalization. For example, the trivial set of words E of the page of fig. 11 ═ { certain, always, person, … … }. So that in the subsequent step, the important phrases in the text are extracted as the final name of the picture by using an information entropy algorithm. And (3) using a rapid word segmentation method to make the final name of the picture as a search engine word segmentation, and storing the obtained word into a picture search word.
Therefore, by adopting natural language analysis algorithms such as Chinese word segmentation and TextRank, the problem that some technologies for marking pictures are not suitable for long texts and are limited to short and small named words is solved. Firstly, performing natural language analysis on each page of a slide and subject words of full text linguistic data, then directly performing natural language analysis on associated texts of each picture, and finally simplifying the associated texts into short and representative file names by combining semantics and slide subjects; not only can proper nouns such as names of people and place names be extracted, but also long sections of subject terms can be extracted, and the subject terms can correspond to the subjects of the slides.
Step S330, based on the subject word set and the trivial word set of each page of the slide, and the full text subject word set and the full text trivial word set of all pages of the slide, determining the named file sentences of all text information in the slide file.
Therefore, on the basis of selecting a proper algorithm to search the corresponding relation between a plurality of pictures and a plurality of text information in each page of the engineering slide, the position relation and the text semantic relation between the pictures and the text blocks in the slide are automatically analyzed by adopting natural language processing, the matching and the automatic naming of the pictures and the texts in the slide are realized, the sentences can be simplified and simultaneously correspond to the subjects of the slide, the accuracy of naming the pictures in the slide file is improved, and the application range of the processing mode is widened.
More optionally, the determining the named file sentences of all text information in the slide file based on the subject term set and the trivial term set of each page of the slide and the full-text subject term set and the full-text trivial term set of all pages of the slide in step S330 may include: and determining the text content with the maximum word size in the part of which the minimum Y-direction data in the text bounding box information of each picture in each page of slide is larger than the set coefficient times of the height of each picture according to the word size and the text bounding box information in the text information of each page of slide in the slide file as the named text sentence of the picture in the page of slide. And analogizing in turn to obtain named text sentences of all pictures in all pages of slides in the slide file, wherein the named text sentences are used as named file sentences of all text information in the slide file.
For example: calculating the named text sentence h of each slide according to the word size and bounding box information of all the text sentences in each slidet. The preferred calculation method or matching method is to select each picture piIn bounding box information of (2)imin>k is per picture piHeight h ofyAll text sentences in the text sentence of (1)iMaximum text sentence tiFor named text statements h of slidestK is preferably 1/3. As shown in FIG. 11, the upper part 1/3 has only the text sentence t above the text sentence3And a text sentence t6Wherein the text sentence t3Is 24, max. The named text statement of the slide is thus the text statement t3
Therefore, the named file sentences of all the text information in the slide file are determined based on the subject word set and the trivial word set of each page of the slide, and the full-text subject word set and the full-text trivial word set of all the pages of the slide, the subject words and the trivial words can be distinguished and processed aiming at each page of the slide and all the slides, and the accuracy of the named file sentences of all the text information in the obtained slide file is favorably ensured.
At step S130, a named text sentence is matched for each picture in the slide file according to the picture information in the slide file and the named text sentence of the slide file, resulting in a picture named text sentence for each picture.
Optionally, in step S130, a named text statement is matched for each picture in the slide file according to the picture information in the slide file and the named text statement of the slide file, such as p for each pictureiMatching the most appropriate named text sentence ti={ci,si,ximin,yimin,ximax,yimaxIs stored to each picture piGet p in the bounding box information ofi={ci,Ximin,Yimin,Ximax,Yimax}. As shown in fig. 12, the method may specifically include:
referring to the flowchart of fig. 6, a specific process of matching a named text sentence for each picture in a slide file in step S130 is further described, where the specific process includes: step S610 to step S640.
Step S610, determining all named text sentences of the picture in the set direction range according to the picture bounding box information in the picture information of each picture in each page of the slide, and obtaining all named text sentences of the picture. As shown in fig. 12, according to the position information p of the picturei={Ximin,Yimin,Ximax,YimaxAnd calculating a text sentence tp which is right above, right below, right left or right { tp }j}={(tj,wj)}. As shown in fig. 11, for picture p1The text sentence right above, right below, left or right may include t 5, 30, 55, 903,t4,t5,t6,t7
Step S620, if all the named text sentences of the picture are empty, determining the named text sentences of the slide on the page where the picture is located as the picture named text sentences of the picture.
For example: as shown in fig. 12, if according to picture piPosition information p ofi={Ximin,Yimin,Ximax,YimaxThe text statements tp directly above, below, to the left or to the right are obtained by calculationjIf the slide is empty, the named text sentence h of the slide is usedtAs picture piNamed text statements of (1).
Step S630, if all the named text sentences of the picture are not empty, determining weights according to all the named text sentences of the picture, and determining matching results between the picture and all the named text sentences according to all the named text sentences of the picture.
Still further optionally, the determining weights according to all named text sentences of the picture in step S630 may include: according to the size of the word size of each named text sentence in all the named text sentences of the picture and the distance between each named text sentence of the picture and the central point of the picture
Figure BDA0002528793020000161
Calculating the overlapping length between each named text sentence of the picture and the picture, and calculating the weight, wherein:
Figure BDA0002528793020000162
Figure BDA0002528793020000163
djis the distance between each named text sentence of the picture and the center point of the picture, ljThe length of the overlap between each named text statement of the picture and the picture is determined.
For example: according to the position information p of the picturei={Ximin,Yimin,Ximax,YimaxThe text statements tp directly above, below, to the left or to the right are obtained by calculationjOf each text sentence tjSize of the font size of, and with picture piThe center point distance and the overlap layer degree of (c) calculating the weight wj(ii) a Preference is given to
Figure BDA0002528793020000164
Wherein d isjIs tjCenter point and pjThe distance between the center points. ljAs picture pjAnd the text sentence tjThe length of overlap therebetween.The preferred calculation formula is as follows:
Figure BDA0002528793020000165
Figure BDA0002528793020000166
as shown in fig. 11, for picture p1Text sentence t3Weight w of30.622; text sentence t4Weight w of41.057; text sentence t5Weight w of5-0.527; text sentence t6Weight w of6-1.02; text sentence t7Weight w of7-0.92; for picture p2Text sentence t3Weight w of3-0.463; text sentence t4Weight w of4-0.365; text sentence t5Weight w of51.01; text sentence t6Weight w of6-0.45. Text sentence t7Weight w of7=-0.63。
Therefore, the reliability and the accuracy of each weight determination can be ensured by determining the weight according to the word size of each named text sentence in all the named text sentences of the picture, the distance between each named text sentence of the picture and the central point of the picture and the overlapping length between each named text sentence of the picture and the picture.
Still further optionally, the determining, in step S630, matching results between the picture and all named text sentences according to all named text sentences of the picture may include: and matching the word segmentation words in each named text sentence of the picture with the subject word set and the trivial word set of each page of the page where the picture is located, and the full-text subject word set and the full-text trivial word set of all the pages of the slides in sequence to obtain a matching result.
For example: text sentence tjThe word-dividing words in (1) are sequentially connected with the subject word set E of the pagekFull text topic word set E0The ordinary word set C of this pagekFull text trivial word set C0Matching the words in the sentence, and then calculating the text sentence t according to the following table according to the matching times of the wordsjAdditional score of (b)j. The matching with the subject word will score and the matching with the trivial word will be deducted, but the score and deduction should not exceed the limit. Preferably, the text sentence tjAdditional score of (b)jReference is made to the following table.
Matching situation Score of each match Limit of this score
Belonging to the subject term set E of this pagek 0.2 0.0~1.0
Belonging to full-text subject term set E0 0.1 0.0~0.5
Belonging to the trivial word set C of this pagek -0.2 -0.6~0.0
Belonging to the full-text trivial word set C0 -0.1 -0.3~0.0
As shown in FIG. 11, a text sentence t3Contains 1 full-text subject term "hospital", so that the text sentence t3Additional score of (b)30.1. Text sentence t4Contains 1 subject word 'maintenance' and 1 full-text trivial word 'personnel' on the page, so that the text sentence t4Additional score of (b)40.2-0.1, and the rest is similar.
Therefore, the word segmentation words in each named text sentence of the picture are sequentially matched with the subject word set and the trivial word set of each page of the page where the picture is located, and the full-text subject word set and the full-text trivial word set of all pages of slides, so that the matching results of the picture and all named text sentences are determined, each page of slides and all pages of slides can be processed, and the comprehensiveness and reliability of the matching results are guaranteed.
And step S640, determining the named text sentence corresponding to the maximum one of the weights of the pictures and the matching results of the pictures as the named text sentence matched with the picture, so as to use the named text sentence as the picture named text sentence of the picture.
For example: as shown in fig. 12, text sentence tiTotal weight w ofj+ text sentence tjAdditional score of (b)jMaximum text sentence tjAs picture piNamed text statements of (1). As shown in fig. 11, picture p1The corresponding named text statement is the text statement t4Picture p2The corresponding named text statement is the text statement t5Picture p3The corresponding named text statement is the text statement t6Picture p4The corresponding named text statement is the text statement t7
Thus, the relevance of the pictures in the slide and the characters on the page in the space position is calculated; then, a keyword and trivial word matching method is adopted to score and quantify key semantic information, so that the technical effects of more accurately corresponding the picture with the slide text block and greatly enhancing the readability and the understandability of the picture naming are achieved.
At step S140, a corresponding relationship between the picture information and the text information in the slide file is established according to the picture information in the slide file and the picture naming text sentence obtained for each picture matching.
The picture information of each page of slide in the slide file may include: the width and height of each slide, and the picture bounding box information for each picture in each slide. The text information of each slide in the slide file may include: the text content, font size, and/or text bounding box information of all text statements of each slide.
Therefore, according to the characteristics of the engineering slide file, such as the characteristic that the slide file is relatively random but has strong correlation, a proper algorithm is selected according to the position relation of the picture and the text content in each slide, the picture and the text block are accurately matched through an intelligent algorithm according to the geometric position information, the method can be used for naming the picture, and the readability, the understandability and the retrievability of the picture name in the slide can be enhanced. The method comprises the following steps of automatically analyzing the position relation and text semantic relation of pictures and text blocks in a slide by adopting natural language processing, and realizing the matching and automatic naming of the pictures and the texts in the slide; and the method adopts a natural language analysis method to simplify the associated text of the picture into short and representative subject words, thereby facilitating the establishment of indexes and quick retrieval.
Optionally, the specific process of establishing the corresponding relationship between the picture information and the text information in the slide file according to the picture information in the slide file and the named text statement of the picture obtained by matching each picture in step S140 may include: and naming a text sentence aiming at the picture of each picture in each page of slide in the slide file, constructing a storage result for each picture, and storing each picture according to the storage result so as to establish the corresponding relation between the picture information and the text information in the slide file. That is, each picture in the slide file is stored as an individual file, and the individual file of each picture is named according to a picture naming text sentence obtained by matching each picture, so as to establish a corresponding relationship between the picture information and the text information in the slide file.
For example: based on picture piNamed text statement ciAnd constructing a final result, wherein the final result can comprise the picture, the final name, the full name of the picture, the search word of the picture and the like.
Therefore, naming and storing are carried out according to the picture information in the slide file and the picture naming text sentence obtained by matching each picture, so that the corresponding relation between the picture information and the text information in the slide file can be quickly and conveniently established for the engineering slide file, and a user can conveniently check and adapt.
More optionally, a specific process of naming a text statement for each picture in each page of slide in the slide file, constructing a storage result for each picture, and storing each picture according to the storage result may be as follows.
With reference to the flowchart of fig. 7 showing an embodiment of the method of the present invention, which constructs a storage result for each picture and stores each picture according to the storage result, further described is a specific process of constructing a storage result for each picture and storing each picture according to the storage result, which may include: step S710 and step S720.
Step S710, aiming at each page of slide, a new folder is created and named by the named text sentence of the page of slide; and independently storing each picture as an independent file, naming the independent file of each picture by using the picture naming text sentence of each picture, and then placing the independent file into the new folder.
For example: the new folder can be named with a lantern slide htNaming, each picture p in the slideiStored independently as a file and named final name such as ciAnd placed into the folder.
Step S720, a storage record is established in the database for the picture. And in the storage record of the picture, determining and storing the picture full name field of the picture according to the picture naming text sentence of the picture.
For example: for picture p in the databaseiEstablishing a record, and directly storing the full name field of the picture based on the picture piNamed text statement ci. Such as p4The full name field is that the lamp tube of the outpatient transfusion room is always on and off.
Therefore, by naming the text sentences aiming at the pictures of each picture in each page of slide in the slide file, constructing a storage result for each picture and storing each picture according to the storage result, the pictures and the texts in the slide file can be conveniently and correspondingly stored based on the project, and the storage and the search are convenient.
Still alternatively, in step S720, in the storage record of the picture, a specific process of determining and storing the picture full name field of the picture according to the picture naming text statement of the picture may be referred to in the following exemplary description.
With reference to the flowchart of fig. 8, which illustrates an embodiment of determining and storing the picture full name field of the picture according to the picture naming text statement of the picture in the method of the present invention, the specific process of determining and storing the picture full name field of the picture according to the picture naming text statement of the picture in step S720 is further described, and may include: step S810 to step S840.
Step 810, if the length of the Chinese character in the picture naming text sentence of the picture is less than or equal to a preset value, directly storing the picture naming text sentence of the picture as a picture full name field of the picture.
Step S820, if the length of the Chinese character in the picture naming text sentence of the picture is larger than a preset value, extracting a set phrase in the picture naming text sentence of the picture by using an information entropy algorithm, and taking the set phrase as a new picture naming text sentence of the picture; and storing the new picture naming text sentence of the picture as the picture full name field of the picture.
For example: if based on picture piNamed text statement ciIf the length is too long, preferably more than 10 Chinese characters, extracting important phrases in the text as the final name of the picture by using an information entropy algorithm, and storing the final name in a database. If based on picture piNamed text statement ciIf the picture is shorter, the final name of the picture is the same as the full name. Such as picture p4The full name of the Chinese character is 14, and the final name is formed by extracting the phrases 'lamp tube of infusion room' and 'on and off'.
Step S830, a quick word segmentation method is used, the picture full name field of the picture is determined as the search engine word segmentation of the picture, and the search engine word segmentation is stored as the picture search word of the picture.
For example: and determining the picture full name field of the picture as the search engine word segmentation of the picture by using a rapid word segmentation method, and storing the search engine word segmentation as the picture search word of the picture.
Step 840, traversing all pictures in the slide file, pairing several pictures with the same picture search term, and storing the pictures as similar pictures in a database.
For example: and performing post-processing, traversing all the pictures, pairing every two pictures with the same search word, and storing the paired pictures as similar pictures into a database to support a picture recommendation algorithm, wherein the final result can be shown in an example shown in fig. 14. As shown in fig. 13, a folder "hospital application" is newly created, and 4 picture files are extracted and named for the slide shown in fig. 11. The 'picture search word' is obtained using a fast word segmentation method. All pictures are traversed, every two pictures with the same search word are paired and stored in a database as similar pictures to support a picture recommendation algorithm, and the final result can be shown in an example shown in fig. 14.
Therefore, the picture full name field of the picture is determined and stored according to the picture naming text sentence of the picture, the storage reliability is guaranteed, the occupied space is small, and the searching convenience is also guaranteed.
Through a large number of tests, by adopting the technical scheme of the embodiment and automatically matching the pictures and the texts in the construction project data slides, the corresponding relation between a plurality of pictures and a plurality of text information in each page of the project slides can be conveniently determined, the pictures are automatically named and independently stored, the extraction, naming and independent storage of the pictures in the project data slides can be rapidly and automatically completed, the subsequent rapid retrieval of precious project pictures according to the picture names can be supported, and the use convenience is improved.
According to the embodiment of the invention, a device for processing the pictures and the texts in the slide is also provided, which corresponds to the method for processing the pictures and the texts in the slide. Referring to fig. 9, a schematic diagram of an embodiment of the apparatus of the present invention is shown. The processing device for pictures and texts in the slides can be mainly applied to the processing of pictures and texts in engineering slide files (i.e. slides in engineering materials), and the processing device for pictures and texts in engineering slide files can comprise: a determination unit 102 and a processing unit 104.
In an alternative example, the determining unit 102 may be configured to determine the picture information and the text information of each page of the slide in the slide file. The specific function and processing of the determination unit 102 are referred to in step S110.
Alternatively, the determining unit 102 may determine the picture information and the text information of each page of the slide in the slide file, and may include:
the determining unit 102 may be further specifically configured to, for each slide in the slide file, obtain a width and a height of each slide, and obtain picture bounding box information of each picture in each slide as the picture information of each slide in the slide file. That is, the picture information of each slide in the slide file may include: the width and height of each slide, and the picture bounding box information for each picture in each slide. The specific function and processing of the determination unit 102 are also referred to in step S210. And the number of the first and second groups,
the determining unit 102 may be further specifically configured to obtain text contents, word sizes, and/or text bounding box information of all text statements in each page of slide as text information of each page of slide in the slide file. That is, the text information of each slide in the slide file may include: the text content, font size, and/or text bounding box information of all text statements of each slide. The specific function and processing of the determination unit 102 are also referred to in step S220.
For example: reading each picture p in slide fileiIs recorded as P ═ Pi},pi={Ximin,Yimin,Ximax,Yimax}; reading the text content, word size and bounding box information of all text sentences in each page of the slide, and recording as T ═ T { (T)i},ti={ci,ximin,yimin,ximax,yimax}. E.g. for page k slide h in the slide filekObtaining a width of hxHeight of hyRead page k slide hkIn each picture piIs recorded as Pk={pi},pi={Ximin,Yimin,Ximax,Yimax}; read page k slide hkThe text content, word size and bounding box information of all the text sentences in the Chinese sentence are recorded as Tk={ti},ti={ci,si,ximin,yimin,ximax,yimax}. Wherein, ciFor text content, siIs the number, ximin、yimin、ximax、yimaxIs bounding box information, i.e., location information.
For example: can be directed to each page of slide h in the slide filekAs shown in FIG. 11, the width is h x210, height hy130. Reading each picture p thereiniIs recorded as P ═ Pi},pi={Ximin,Yimin,Ximax,Yimax}. For each page of the slide h, reading the text content, word size and bounding box information of all text sentences in the slide h, and recording as T ═ Ti},ti={ci,si,ximin,yimin,ximax,yimax}. As shown in fig. 11, there are four pictures P ═ { P ═ P1,p2,p3,p4},p1={5,30,55,90},p260, 40, 105, 80; there are 7 text sentences T ═ T1,t2,t3,t4,t5,t6,t7Where t is3-hospital use of' 24, 10, 102, 50, 108}, t { "hospital use of some chinese medicine", t4"serviceman workload and level assessment", 14, 10, 23, 50, 27}, t5{ "building weak link assessment", 14, 107, 47, 113, 77 }.
Thus, by first determining the picture information and text information of each page of slide in the slide file, the pictures and texts in the project slide file can be processed conveniently based on the picture information and text information of each page of slide.
In an alternative example, the processing unit 104 may be configured to perform natural language analysis processing on the text information of all pages of slides in the slide file to obtain named text statements of all pages of slides in the slide file, so that the named text statements of the slide file may be determined according to the text information in the slide file. The specific functions and processes of the processing unit 104 are shown in step S120.
Alternatively, the processing unit 104 may perform natural language analysis processing on the text information of all the pages of slides in the slide file, and may include:
the processing unit 104 may be further specifically configured to determine, based on the text information of all pages of slides in the slide file, corpus information of each page of slides in the slide file, and full-text corpus information of all pages of slides in the slide file. The specific functions and processes of the processing unit 104 are also referred to in step S310.
More optionally, the processing unit 104 determines the corpus information of each page of each slide in the slide file and the full-text corpus information of all pages of slides in the slide file based on the text information of all pages of slides in the slide file, which may include:
the processing unit 104 may be further specifically configured to connect text information of each page of slides in the slide file according to a first setting order to form each page of corpus information (e.g., page corpus W) of each page of slidesk). The specific functions and processes of the processing unit 104 are also referred to in step S410. And the number of the first and second groups,
the processing unit 104 may be further configured to, for text information of all page slides in the slide file, remove text information that repeatedly appears at the same position in different page slides, and obtain corrected text information of all page slides; and connecting the corrected text information of all the page slides according to a second set sequence to form full text corpus information (such as full text corpus W) of all the page slides0). The specific function and processing of the processing unit 104 are also referred to in step S420.
For example: composing the text of the page k slide into a section according to the sequence from top to bottom and from left to right to form a page corpus Wk. Then according to the sequence of slide film pages, all page corpora are formed into full text corpora W0However, before the connection, the text sentences repeatedly appearing at the same position in different slides should be deleted to correct the text sentence set T of each slidek. As shown in FIG. 11, text t2Is the title name of the slide, and can be removed by repeatedly appearing in all slides. Text t1The chapter name can be repeatedly appeared at the same position in a plurality of slides before and after the slide, and can be deleted.
Therefore, the corpus information of each page of the slide in the slide file and the full-text corpus information of all pages of the slides in the slide file are determined based on the text information of all pages of the slides in the slide file, and each page of the slides and all the slides can be processed respectively, so that the comprehensiveness and the accuracy of processing the pictures and the texts in the engineering slide file can be guaranteed.
The processing unit 104 may be further configured to perform natural language analysis processing on each page of corpus information and full-text corpus information by using a natural language analysis method, so as to obtain a subject word set and a trivial word set of each page of slide, and a full-text subject word set and a full-text trivial word set of all pages of slides. The specific functions and processes of the processing unit 104 are also referred to in step S320.
More optionally, the processing unit 104 performs natural language analysis processing on each page of corpus information and full-text corpus information by using a natural language analysis method, which may include: and respectively carrying out natural language analysis processing on each page of corpus information and full-text corpus information to obtain a subject word set and a trivial word set of each page of the slideshow, and a full-text subject word set and a full-text trivial word set of all pages of the slideshow. For example: respectively to page corpus (i.e. page corpus W)k) And slide file corpus (i.e., full text corpus W)0) Performing natural language analysis to obtain a subject word set E of each pagek={ek,iThe trivial word set C per pagek={ck,iFull text subject term set E0={e0,iSet of full-text trivial words C0={c0,i}. More specific processing procedures may be as follows:
the processing unit 104 may be further configured to perform natural language analysis processing on each page of corpus information and full-text corpus information to obtain a subject word set and a trivial word set of each page of a slide. And performing natural language analysis processing on each page of corpus information and full-text corpus information to obtain a full-text subject word set and a full-text trivial word set of all pages of slides. The process of performing natural language analysis processing on any corpus information in each page of corpus information and full-text corpus information may further specifically include the following processes:
the processing unit 104 may be further configured to perform chinese word segmentation on each page of corpus information and each corpus information in the full-text corpus information by using an N shortest path word segmentation algorithm, so as to obtain a word segmentation result. In the word segmentation result, the sentence in each corpus information is segmented into words and phrases with set specifications and set proper nouns to obtain the word segmentation. The specific functions and processes of the processing unit 104 are also referred to in step S510.
For example: and performing Chinese word segmentation operation on the speech by using an N shortest path word segmentation algorithm, and segmenting the sentence into short words, phrases and proper nouns. For example, "serviceman workload and proficiency rating" will be divided into { serviceman, personnel, workload, and, proficiency, rating }.
The processing unit 104 may be further configured to select, by using a TextRank algorithm, a set number of words in the word segmentation result of each corpus according to a set score order, as a subject word set (e.g., a subject word set E) of the corpus. The specific function and processing of the processing unit 104 are also referred to in step S520.
For example: and selecting the 10 words with the highest scores as the subject word set E of the corpus by using a TextRank algorithm. These terms are characterized by high frequency of occurrence and strong association with other subject terms. For example, the topic word set E of case PPT is { repair, work order, hospital, … … }.
The processing unit 104 may be further specifically configured to classify a term in the corpus that meets the trivial word criterion (i.e., a term that does not belong to the topic word set but has a higher frequency than any topic word) into the trivial word set (e.g., the trivial word set C) of the corpus. The specific functions and processes of the processing unit 104 are also referred to in step S530.
For example: and classifying words which do not belong to the subject word set but have higher frequency than any subject word in the corpus into a trivial word set C. These trivial words are characterized by being used frequently in many different corpora, and therefore, they do not have a degree of identification, cannot be used as keywords in a particular corpus, and rather have a negative effect on semantic generalization. For example, the trivial set of words E of the page of fig. 11 ═ { certain, always, person, … … }. So that in the subsequent step, the important phrases in the text are extracted as the final name of the picture by using an information entropy algorithm. And (3) using a rapid word segmentation method to make the final name of the picture as a search engine word segmentation, and storing the obtained word into a picture search word.
Therefore, by adopting natural language analysis algorithms such as Chinese word segmentation and TextRank, the problem that some technologies for marking pictures are not suitable for long texts and are limited to short and small named words is solved. Firstly, performing natural language analysis on each page of a slide and subject words of full text linguistic data, then directly performing natural language analysis on associated texts of each picture, and finally simplifying the associated texts into short and representative file names by combining semantics and slide subjects; not only can proper nouns such as names of people and place names be extracted, but also long sections of subject terms can be extracted, and the subject terms can correspond to the subjects of the slides.
The processing unit 104 may be further specifically configured to determine named file statements of all text information in the slide file based on the subject term set and the trivial term set of each page of each slide, and the full-text subject term set and the full-text trivial term set of all pages of the slides. The specific functions and processes of the processing unit 104 are also referred to in step S330.
Therefore, on the basis of selecting a proper algorithm to search the corresponding relation between a plurality of pictures and a plurality of text information in each page of the engineering slide, the position relation and the text semantic relation between the pictures and the text blocks in the slide are automatically analyzed by adopting natural language processing, the matching and the automatic naming of the pictures and the texts in the slide are realized, the sentences can be simplified and simultaneously correspond to the subjects of the slide, the accuracy of naming the pictures in the slide file is improved, and the application range of the processing mode is widened.
More optionally, the processing unit 104 determines the named file statement of all text information in the slide file based on the subject term set and the trivial term set of each page of each slide, and the subject term set and the trivial term set of all pages of the slide, and may include: the processing unit 104 may be further configured to determine, according to the word size and the text bounding box information in the text information of each page of slide in the slide file, the text content with the largest word size in a portion where the minimum Y-direction data in the text bounding box information of each picture in each page of slide is larger than a set coefficient times of the height of each picture, as the named text statement of the picture in the page of slide. And analogizing in turn to obtain named text sentences of all pictures in all pages of slides in the slide file, wherein the named text sentences are used as named file sentences of all text information in the slide file.
For example: according to all the texts in each slideThe word size and bounding box information of the sentence, the named text sentence h of the slide is calculatedt. Preferably, the computing device or the matching device selects each picture piIn bounding box information of (2)imin>k is per picture piHeight h ofyAll text sentences in the text sentence of (1)iMaximum text sentence tiFor named text statements h of slidestK is preferably 1/3. As shown in FIG. 11, the upper part 1/3 has only the text sentence t above the text sentence3And a text sentence t6Wherein the text sentence t3The font size of (a) is 24, max; the named text statement of the slide is thus the text statement t3
Therefore, the named file sentences of all the text information in the slide file are determined based on the subject word set and the trivial word set of each page of the slide, and the full-text subject word set and the full-text trivial word set of all the pages of the slide, the subject words and the trivial words can be distinguished and processed aiming at each page of the slide and all the slides, and the accuracy of the named file sentences of all the text information in the obtained slide file is favorably ensured.
In an alternative example, the processing unit 104 may be further configured to match the named text statement for each picture in the slide file according to the picture information in the slide file and the named text statement of the slide file, so as to obtain a picture named text statement for each picture. The specific function and processing of the processing unit 104 are also referred to in step S130.
Optionally, the processing unit 104 matches a named text statement for each picture in the slide file, such as p for each picture, according to the picture information in the slide file and the named text statement of the slide fileiMatching the most appropriate named text sentence ti={ci,si,ximin,yimin,ximax,yimaxIs stored to each picture piGet p in the bounding box information ofi={ci,Ximin,Yimin,Ximax,Yimax}. As shown in fig. 12, the method may specifically include:
the processing unit 104 may be further configured to determine all named text sentences of the picture in the set direction range according to the picture bounding box information in the picture information of each picture in each page of the slide, so as to obtain all named text sentences of the picture. The specific functions and processes of the processing unit 104 are also referred to in step S610. As shown in fig. 12, according to the position information p of the picturei={Ximin,Yimin,Ximax,YimaxAnd calculating a text sentence tp which is right above, right below, right left or right { tp }j}={(tj,wj)}. As shown in fig. 11, for picture p1The text sentence right above, right below, left or right may include t 5, 30, 55, 903,t4,t5,t6,t7
The processing unit 104 may be further specifically configured to determine, if all the named text sentences of the picture are empty, the named text sentence of the slide on the page where the picture is located as the picture named text sentence of the picture. The specific functions and processes of the processing unit 104 are also referred to in step S620.
For example: as shown in fig. 12, if according to picture piPosition information p ofi={Ximin,Yimin,Ximax,YimaxThe text statements tp directly above, below, to the left or to the right are obtained by calculationjIf the slide is empty, the named text sentence h of the slide is usedtAs picture piNamed text statements of (1).
The processing unit 104 may be further specifically configured to determine weights according to all the named text sentences of the picture if all the named text sentences of the picture are not empty, and determine matching results between the picture and all the named text sentences according to all the named text sentences of the picture. The specific function and processing of the processing unit 104 are also referred to in step S630.
More optionally, the processing unit 104 determines the weight according to all named text sentences of the picture, and may include: treatment ofThe unit 104 may be further configured to calculate a weight according to a size of a font size of each named text sentence in all named text sentences of the picture, a distance between each named text sentence of the picture and a center point of the picture, and an overlapping length between each named text sentence of the picture and the picture
Figure BDA0002528793020000261
Wherein:
Figure BDA0002528793020000262
Figure BDA0002528793020000263
djis the distance between each named text sentence of the picture and the center point of the picture, ljThe length of the overlap between each named text statement of the picture and the picture is determined.
For example: according to the position information p of the picturei={Ximin,Yimin,Ximax,YimaxThe text statements tp directly above, below, to the left or to the right are obtained by calculationjOf each text sentence tjSize of the font size of, and with picture piThe center point distance and the overlap layer degree of (c) calculating the weight wj(ii) a Preference is given to
Figure BDA0002528793020000264
Wherein d isjIs tjCenter point and pjThe distance between the center points. ljAs picture pjAnd the text sentence tjThe length of overlap therebetween. The preferred calculation formula is as follows:
Figure BDA0002528793020000271
Figure BDA0002528793020000272
as shown in fig. 11, for picture p1Text sentence t3Weight w of30.622; text sentence t4Weight w of41.057; text sentence t5Weight w of5-0.527; text sentence t6Weight w of6-1.02; text sentence t7Weight w of7-0.92; for picture p2Text sentence t3Weight w of3-0.463; text sentence t4Weight w of4-0.365; text sentence t5Weight w of51.01; text sentence t6Weight w of6-0.45; text sentence t7Weight w of7=-0.63。
Therefore, the reliability and the accuracy of each weight determination can be ensured by determining the weight according to the word size of each named text sentence in all the named text sentences of the picture, the distance between each named text sentence of the picture and the central point of the picture and the overlapping length between each named text sentence of the picture and the picture.
More optionally, the determining, by the processing unit 104, a matching result between the picture and all named text sentences according to all named text sentences of the picture may include: the processing unit 104 may be further configured to match the word segmentation words in each named text sentence of the picture with the subject word set and the trivial word set of each page of the page where the picture is located, and the full-text subject word set and the full-text trivial word set of all the page slides in sequence, so as to obtain a matching result.
For example: text sentence tjThe word-dividing words in (1) are sequentially connected with the subject word set E of the pagekFull text topic word set E0The ordinary word set C of this pagekFull text trivial word set C0Matching the words in the sentence, and then calculating the text sentence t according to the following table according to the matching times of the wordsjAdditional score of (b)j. Matching with subject word will score, matching with trivial word will deduct mark, but score and deduction are notThe limit should be exceeded. Preferably, the text sentence tjAdditional score of (b)jReference is made to the following table.
Matching situation Score of each match Limit of this score
Belonging to the subject term set E of this pagek 0.2 0.0~1.0
Belonging to full-text subject term set E0 0.1 0.0~0.5
Belonging to the trivial word set C of this pagek -0.2 -0.6~0.0
Belonging to the full-text trivial word set C0 -0.1 -0.3~0.0
As shown in FIG. 11, a text sentence t3Contains 1 full-text subject term "hospital", so that the text sentence t3Additional score of (b)30.1. Text sentence t4Contains 1 subject word 'maintenance' and 1 full-text trivial word 'personnel' on the page, so that the text sentence t4Is attached withAdding score b40.2-0.1, and the rest is similar.
Therefore, the word segmentation words in each named text sentence of the picture are sequentially matched with the subject word set and the trivial word set of each page of the page where the picture is located, and the full-text subject word set and the full-text trivial word set of all pages of slides, so that the matching results of the picture and all named text sentences are determined, each page of slides and all pages of slides can be processed, and the comprehensiveness and reliability of the matching results are guaranteed.
And the processing unit 104 may be further configured to determine, according to a maximum one of the sum of the weight of the picture and the matching result of the picture, a named text sentence corresponding to the maximum one as a named text sentence matched with the picture, so as to use the named text sentence as the picture named text sentence of the picture. The specific functions and processes of the processing unit 104 are also referred to in step S640.
For example: as shown in fig. 12, text sentence tiTotal weight w ofj+ text sentence tjAdditional score of (b)jMaximum text sentence tjAs picture piNamed text statements of (1). As shown in fig. 11, picture p1The corresponding named text statement is the text statement t4Picture p2The corresponding named text statement is the text statement t5Picture p3The corresponding named text statement is the text statement t6Picture p4The corresponding named text statement is the text statement t7
Thus, the relevance of the pictures in the slide and the characters on the page in the space position is calculated; then, a keyword and trivial word matching device is adopted to score and quantify key semantic information, so that the technical effects of more accurately corresponding the picture with the slide text block and greatly enhancing the readability and the understandability of the picture naming are achieved.
In an optional example, the processing unit 104 may be further configured to establish a correspondence between the picture information and the text information in the slide file according to the picture information in the slide file and a named text statement of the picture obtained by matching for each picture. The specific function and processing of the processing unit 104 are also referred to in step S140.
The picture information of each page of slide in the slide file may include: the width and height of each slide, and the picture bounding box information for each picture in each slide. The text information of each slide in the slide file may include: the text content, font size, and/or text bounding box information of all text statements of each slide.
Therefore, according to the characteristics of the engineering slide file, such as the characteristic that the slide file is relatively random but has strong correlation, a proper algorithm is selected according to the position relation of the picture and the text content in each slide, the picture and the text block are accurately matched through an intelligent algorithm according to the geometric position information, the method can be used for naming the picture, and the readability, the understandability and the retrievability of the picture name in the slide can be enhanced. The method comprises the following steps of automatically analyzing the position relation and text semantic relation of pictures and text blocks in a slide by adopting natural language processing, and realizing the matching and automatic naming of the pictures and the texts in the slide; the natural language analysis device is adopted to simplify the associated text of the picture into short and representative subject words, thereby facilitating the establishment of indexes and quick retrieval.
Optionally, the processing unit 104 establishes a correspondence between the picture information and the text information in the slide file according to the picture information in the slide file and the named text statement of the picture obtained by matching for each picture, and may include:
the processing unit 104 may be further specifically configured to name a text statement for a picture of each picture in each page of the slide in the slide file, construct a storage result for each picture, and store each picture according to the storage result, so as to establish a corresponding relationship between the picture information and the text information in the slide file. That is, each picture in the slide file is stored as an individual file, and the individual file of each picture is named according to a picture naming text sentence obtained by matching each picture, so as to establish a corresponding relationship between the picture information and the text information in the slide file.
For example: based on picture piNamed text statement ciAnd constructing a final result, wherein the final result can comprise the picture, the final name, the full name of the picture, the search word of the picture and the like.
Therefore, naming and storing are carried out according to the picture information in the slide file and the picture naming text sentence obtained by matching each picture, so that the corresponding relation between the picture information and the text information in the slide file can be quickly and conveniently established for the engineering slide file, and a user can conveniently check and adapt.
Optionally, the processing unit 104 may construct a storage result for each picture in a picture naming text statement of each picture in each page of slide in the slide file, and store each picture according to the storage result, and may include:
the processing unit 104 may be further configured to, for each page of slide, newly create a folder and name the folder by a named text statement of the page of slide; and independently storing each picture as an independent file, naming the independent file of each picture by using the picture naming text sentence of each picture, and then placing the independent file into the new folder. The specific functions and processes of the processing unit 104 are also referred to in step S710.
For example: the new folder can be named with a lantern slide htNaming, each picture p in the slideiStored independently as a file and named final name such as ciAnd placed into the folder.
The processing unit 104 may be further configured to establish a storage record for the picture in the database; and in the storage record of the picture, determining and storing the picture full name field of the picture according to the picture naming text sentence of the picture. The specific functions and processes of the processing unit 104 are also referred to in step S720.
For example: for picture p in the databaseiEstablishing a record, and directly storing the full name field of the picture based on the picture piNamed text statement ci. Such as, for example,p4the full name field is that the lamp tube of the outpatient transfusion room is always on and off.
Therefore, by naming the text sentences aiming at the pictures of each picture in each page of slide in the slide file, constructing a storage result for each picture and storing each picture according to the storage result, the pictures and the texts in the slide file can be conveniently and correspondingly stored based on the project, and the storage and the search are convenient.
More optionally, the determining and storing, by the processing unit 104, the full name field of the picture according to the picture naming text statement of the picture in the storage record of the picture may include:
the processing unit 104 may be further specifically configured to directly store the picture naming text statement of the picture as the picture full name field of the picture if the length of the chinese character in the picture naming text statement of the picture is smaller than or equal to a preset value. The specific functions and processes of the processing unit 104 are also referred to in step S810.
The processing unit 104 may be further specifically configured to, if the length of a chinese character in the picture naming text statement of the picture is greater than a preset value, extract a set phrase in the picture naming text statement of the picture using an information entropy algorithm, and use the set phrase as a new picture naming text statement of the picture; and storing the new picture naming text sentence of the picture as the picture full name field of the picture. The specific function and processing of the processing unit 104 are also referred to in step S820.
For example: if based on picture piNamed text statement ciIf the length is too long, preferably more than 10 Chinese characters, extracting important phrases in the text as the final name of the picture by using an information entropy algorithm, and storing the final name in a database. If based on picture piNamed text statement ciIf the picture is shorter, the final name of the picture is the same as the full name. Such as picture p4The full name of the Chinese character is 14, and the final name is formed by extracting the phrases 'lamp tube of infusion room' and 'on and off'.
The processing unit 104 may be further configured to determine, by using a fast word segmentation method, the picture full name field of the picture as the search engine word segmentation of the picture, and store the search engine word segmentation as the picture search word of the picture. The specific functions and processes of the processing unit 104 are also referred to in step S830.
For example: and determining the picture full name field of the picture as the search engine word segmentation of the picture by using a rapid word segmentation method, and storing the search engine word segmentation as the picture search word of the picture.
The processing unit 104 may be further configured to traverse all the pictures in the slide file, pair several pictures with the same picture search term, and store the paired pictures as similar pictures in the database. The specific functions and processes of the processing unit 104 are also referred to in step S840.
For example: and performing post-processing, traversing all the pictures, pairing every two pictures with the same search word, and storing the paired pictures as similar pictures into a database to support a picture recommendation algorithm, wherein the final result can be shown in an example shown in fig. 14. As shown in fig. 13, a folder "hospital application" is newly created, and 4 picture files are extracted and named for the slide shown in fig. 11. The 'picture search word' is obtained using a fast word segmentation method. All pictures are traversed, every two pictures with the same search word are paired and stored in a database as similar pictures to support a picture recommendation algorithm, and the final result can be shown in an example shown in fig. 14.
Therefore, the picture full name field of the picture is determined and stored according to the picture naming text sentence of the picture, the storage reliability is guaranteed, the occupied space is small, and the searching convenience is also guaranteed.
Since the processes and functions implemented by the apparatus of this embodiment substantially correspond to the embodiments, principles and examples of the method shown in fig. 1 to 8, the description of this embodiment is not detailed, and reference may be made to the related descriptions in the foregoing embodiments, which are not repeated herein.
Through a large number of tests, the technical scheme of the invention automatically analyzes the position relation and text semantic relation between the pictures and the text blocks in the slides by adopting natural language processing according to the characteristics of large quantity of pictures and more text information of the engineering slide files, realizes the matching and automatic naming of the pictures and the texts in the slides, can conveniently determine the corresponding relation between a plurality of pictures and a plurality of text information in each page of the engineering slides, and can support the quick retrieval and the repeated use of the slide pictures.
According to an embodiment of the present invention, there is also provided a terminal corresponding to a processing apparatus of pictures and texts in a slide show. The terminal may include: the above-mentioned processing device for pictures and texts in a slide.
Considering that the engineering slide has the characteristics of large quantity of pictures and more character information, and certain difficulty is inevitably brought to processing of searching and using the engineering slide, so that the selection of a proper algorithm to search the corresponding relation between a plurality of pictures and a plurality of text information in each page of the engineering slide is particularly important.
Some software for extracting slide pictures does not retain relevant text content. The engineering slide material is generally composed of engineering pictures and text sentences related to the contents of the pictures. Considering that there is a strong correlation between the pictures in the slide and the text on the page in both content and spatial position, if such information can be utilized, the readability, understandability and retrievability of the picture naming will be greatly enhanced. However, the number of pictures and text blocks in the slide is large, the positions are relatively random, the text information is dense, and how to accurately extract the text sentences corresponding to the pictures from the slide is a difficult problem.
In most of the picture and context information matching methods, the structuring degree is high, and the upper text and the lower text of a single picture are more definite semi-structured texts, such as web page format texts and word format texts. While for a slide, there may be a case where multiple pictures and multiple words are randomly combined and arranged, it is very difficult to accurately match the most relevant text for each picture, and some techniques have low accuracy in matching and naming pictures and words in the slide.
In addition, some technologies of marking pictures through texts are limited to short and short proper nouns such as names of people and place names, but slide files are mainly long natural sentences which are directly used as picture file names and are overlong; therefore, further, on the basis of selecting a proper algorithm to find the corresponding relationship between the plurality of pictures and the plurality of text messages in each page of the engineering slide, how to correspond to the topic of the slide while simplifying the sentence is a problem to be further solved.
In an optional embodiment, the scheme of the invention provides a method for automatically matching pictures and texts in a slide and naming the pictures, in particular to a method for automatically matching the pictures and texts in a slide of construction engineering materials, automatically naming the pictures and independently storing the pictures, which can quickly and automatically complete the extraction, naming and independent storage of the pictures in the slide file of the engineering materials and support the subsequent quick retrieval of precious engineering pictures according to picture names.
Specifically, according to the characteristics of the engineering slide file, the natural language processing is adopted, the position relation and the text semantic relation between the pictures and the text blocks in the slide are automatically analyzed, the matching and the automatic naming of the pictures and the texts in the slide are realized, and the rapid retrieval and the repeated use of the slide pictures are supported.
In an alternative embodiment, in an aspect of the present invention, a method for automatically matching pictures in a slide and naming pictures may include the following steps:
step 1: reading each picture p in slide fileiIs recorded as P ═ Pi},pi={Ximin,Yimin,Ximax,Yimax}; reading the text content, word size and bounding box information of all text sentences in each page of the slide, and recording as T ═ T { (T)i},ti={ci,ximin,yimin,ximax,yimax}。
For example: can be directed to the k page slide h in the slide filekObtaining a width of hxHeight of hyRead outPage k slide hkIn each picture piIs recorded as Pk={pi},pi={Ximin,Yimin,Ximax,Yimax}; read page k slide hkThe text content, word size and bounding box information of all the text sentences in the Chinese sentence are recorded as Tk={ti},ti={ci,si,ximin,yimin,ximax,yimax}. Wherein, ciFor text content, siIs the number, ximin、yimin、ximax、yimaxIs bounding box information, i.e., location information.
Wherein capital indicates bounding box limits, e.g. Ximin、Yimin、Ximax、YimaxEtc.; lower case is a coordinate value, e.g. ximin、yimin、ximax、yimax(ii) a Since the upper, lower, left and right limits of the bounding box are not a common coordinate concept, but refer to straight lines parallel to the coordinate axes, as indicated by the four intersecting dashed lines in fig. 11. Bounding boxes, i.e. geometric or positional information, are a kind of detailed positional information, which not only mark the position, but also directly derive the geometric dimensions of the object.
Specifically, in step 1, one can target each page of slide h in the slide filekAs shown in FIG. 11, the width is h x210, height hy130. Reading each picture p thereiniIs recorded as P ═ Pi},pi={Ximin,Yimin,Ximax,Yimax}. For each page of the slide h, reading the text content, word size and bounding box information of all text sentences in the slide h, and recording as T ═ Ti},ti={ci,si,ximin,yimin,ximax,yimax}。
For example: as shown in fig. 11, there are four pictures P ═ { P ═ P1,p2,p3,p4},p1={5,30,55,90},p260, 40, 105, 80; there are 7 text sentences T ═ T1,t2,t3,t4,t5,t6,t7Where t is3-hospital use of' 24, 10, 102, 50, 108}, t { "hospital use of some chinese medicine", t4"serviceman workload and level assessment", 14, 10, 23, 50, 27}, t5{ "building weak link assessment", 14, 107, 47, 113, 77 }.
Corresponding to step 1, in the course of actual use, step 1 may be performed using the slide information extraction module 1. The operations performed by the slide information extraction module 1 can refer to the related description of step 1, and are not described herein again.
Step 2: composing the text of the page k slide into a section according to the sequence from top to bottom and from left to right to form a page corpus Wk. Then according to the sequence of slide film pages, all page corpora are formed into full text corpora W0However, before the connection, the text sentence set T of each slide should be correctedkSpecifically, the text sentence repeatedly appearing at the same position of the slide is deleted. For example: as shown in FIG. 11, text t2The title names of the slides are repeated in all the slides and can be removed; text t1The chapter name can be repeatedly appeared at the same position in a plurality of slides before and after the slide, and can be deleted.
Corresponding to step 2, in the actual use process, step 2 may be performed by using the text sentence preprocessing module 2. The operation performed by the text sentence preprocessing module 2 can refer to the relevant description of step 2, and is not described herein again.
And step 3: respectively to page corpus (i.e. page corpus W)k) And slide file corpus (i.e., full text corpus W)0) Performing natural language analysis to obtain a subject word set E of each pagek={ek,iA set C of trivial words (i.e. words not belonging to the subject word set but having a higher frequency than any subject word) per pagek={ck,iFull text subject term set E0={e0,iSet of full-text trivial words C0={c0,i}. Wherein,the processing of the page corpus and the slide file corpus is similar and may include the following specific steps.
Step 3.1: and performing Chinese word segmentation operation on the speech by using an N shortest path word segmentation algorithm, and segmenting the sentence into short words, phrases and proper nouns. For example, "serviceman workload and proficiency rating" will be divided into { serviceman, personnel, workload, and, proficiency, rating }.
Wherein, the words can be units with independent meanings formed by 1-3 Chinese characters. The phrase can be a sentence fragment consisting of 2 or more than 2 related words. The proper noun may be a specific or unique person or thing (name of person, place, etc.).
Step 3.2: and selecting the 10 words with the highest scores as the subject word set E of the corpus by using a TextRank algorithm. These terms are characterized by high frequency of occurrence and strong association with other subject terms. For example, the topic word set E of case PPT is { repair, work order, hospital, … … }.
Step 3.3: and classifying the words in the corpus which meet the standard of the trivial words into a trivial word set C. These trivial words are characterized by being used frequently in many different corpora, and therefore, they do not have a degree of identification, cannot be used as keywords in a particular corpus, and rather have a negative effect on semantic generalization. For example, the trivial set of words E of the page of fig. 11 ═ { certain, always, person, … … }. In the subsequent step, the important phrases in the text are extracted as the final name of the picture by using an information entropy algorithm. And (3) using a rapid word segmentation method to make the final name of the picture as a search engine word segmentation, and storing the obtained word into a picture search word.
Corresponding to step 3, in the course of actual use, step 3 may be performed using the natural language analysis module 3. The operations performed by the natural language analysis module 3 can refer to the related description of step 3, and are not described herein again.
And 4, step 4: calculating the named text sentence h of each slide according to the word size and bounding box information of all the text sentences in each slidet. A preferred calculation method or matching method is,select each picture piIn bounding box information of (2)imin>k is per picture piHeight h ofyAll text sentences in the text sentence of (1)iMaximum text sentence tiFor named text statements h of slidestK is preferably 1/3. As shown in FIG. 11, the upper part 1/3 has only the text sentence t above the text sentence3And a text sentence t6Wherein the text sentence t3The font size of (a) is 24, max; the named text statement of the slide is thus the text statement t3
Corresponding to step 4, in the course of actual use, step 4 may be performed using slide name matching module 4. The operation performed by the slide name matching module 4 can refer to the related description of step 4, and is not described herein again.
And 5: for each picture piMatching the most appropriate named text sentence ti={ci,si,ximin,yimin,ximax,yimaxIs stored to each picture piGet p in the bounding box information ofi={ci,Ximin,Yimin,Ximax,Yimax}. As shown in fig. 12, the method may specifically include the following steps:
step 5.1 according to the position information p of the picturei={Ximin,Yimin,Ximax,YimaxAnd calculating a text sentence tp which is right above, right below, right left or right { tp }j}={(tj,wj)}. As shown in fig. 11, for picture p15, 30, 55, 90, the text sentence right above, right below, left or right includes t3,t4,t5,t6,t7
Step 5.2 according to the position information p of the picturei={Ximin,Yimin,Ximax,YimaxThe text statements tp directly above, below, to the left or to the right are obtained by calculationjOf each text sentence tjSize of the font size of, and with picture piCalculating the weight w of the distance from the center point and the overlap lengthj(ii) a Preference is given to
Figure BDA0002528793020000351
Wherein d isjIs tjCenter point and pjThe distance between the center points. ljAs picture pjAnd the text sentence tjThe length of overlap therebetween. The preferred calculation formula is as follows:
Figure BDA0002528793020000352
Figure BDA0002528793020000353
as shown in fig. 11, for picture p1Text sentence t3Weight w of30.622; text sentence t4Weight w of41.057; text sentence t5Weight w of5-0.527; text sentence t6Weight w of6-1.02; text sentence t7Weight w of7-0.92; for picture p2Text sentence t3Weight w of3-0.463; text sentence t4Weight w of4-0.365; text sentence t5Weight w of51.01; text sentence t6Weight w of6-0.45; text sentence t7Weight w of7=-0.63。
Step 5.3 text statement tjThe word-dividing words in (1) are sequentially connected with the subject word set E of the pagekFull text topic word set E0The ordinary word set C of this pagekFull text trivial word set C0Matching the words in the sentence, and then calculating the text sentence t according to the following table according to the matching times of the wordsjAdditional score of (b)j. The matching with the subject word will score and the matching with the trivial word will be deducted, but the score and deduction should not exceed the limit. Preferably, the text sentence tjAdditional score of (b)jReference is made to the following table.
Matching situation Score of each match Limit of this score
Belonging to the subject term set E of this pagek 0.2 0.0~1.0
Belonging to full-text subject term set E0 0.1 0.0~0.5
Belonging to the trivial word set C of this pagek -0.2 -0.6~0.0
Belonging to the full-text trivial word set C0 -0.1 -0.3~0.0
As shown in FIG. 11, a text sentence t3Contains 1 full-text subject term "hospital", so that the text sentence t3Additional score of (b)30.1. Text sentence t4Contains 1 subject word 'maintenance' and 1 full-text trivial word 'personnel' on the page, so that the text sentence t4Additional score of (b)40.2-0.1, and the rest is similar.
Step 5.4 text statement tiTotal weight w ofj+ text sentence tjAdditional score of (b)jMaximum text sentence tjAs picture piNamed text statements of (1). As shown in fig. 11, picture p1The corresponding named text statement is the text statement t4Picture p2The corresponding named text statement is the text statement t5Picture p3The corresponding named text statement is the text statement t6Picture p4The corresponding named text statement is the text statement t7
Step 5.5 if according to Picture piPosition information p ofi={Ximin,Yimin,Ximax,YimaxThe text statements tp directly above, below, to the left or to the right are obtained by calculationjIf the slide is empty, the named text sentence h of the slide is usedtAs picture piNamed text statements of (1).
Corresponding to step 5, in the course of actual use, step 5 may be performed using the picture name matching module 5. The operations performed by the picture name matching module 5 can refer to the related description of step 5, and are not described herein again.
Step 6: based on picture piNamed text statement ciThe final result may include the picture itself, the final name, the full name of the picture, the picture search term, and the like, and specifically may include the following steps:
step 6.1 can give slide title h to the newly created foldertNaming, each picture p in the slideiStored independently as a file and named final name such as ciAnd placed into the folder.
Step 6.2 Picture p in databaseiEstablishing a record, and directly storing the full name field of the picture based on the picture piNamed text statement ci. Such as p4The full name field is that the lamp tube of the outpatient transfusion room is always on and off.
Step 6.3 if based on Picture piNamed text statement ciIf the length is too long, preferably more than 10 Chinese characters, the information entropy algorithm is usedAnd extracting important phrases in the text, using the extracted important phrases as the final name of the picture, and storing the final name in a database. If based on picture piNamed text statement ciIf the picture is shorter, the final name of the picture is the same as the full name. Such as picture p4The full name of the Chinese character is 14, and the final name is formed by extracting the phrases 'lamp tube of infusion room' and 'on and off'.
Step 6.4, using a rapid word segmentation method to make the final name of the picture as a search engine word segmentation, and storing the obtained word into a picture search word; when subsequently retrieved, only the search terms are matched, not the full name, so that ambiguity can be avoided. For example, picture p4The picture retrieval word is { transfusion, transfusion room, lamp tube, on, off }. Then, a post-processing is performed, all the pictures are traversed, every two pictures with the same search term are paired and stored in the database as similar pictures to support the picture recommendation algorithm, and the final result can be shown in the example shown in fig. 14.
That is, in step 6.2 to step 6.4, the picture p is in the databaseiEstablishing a record, and directly storing the full name field of the picturei. If c isiIf the length is too long, preferably more than 10 Chinese characters, extracting important phrases in the text as the final name of the picture by using an information entropy algorithm, and storing the final name in a database. The 'picture search word' is obtained using a fast word segmentation method. And traversing all the pictures, pairing every two pictures with the same search word, and storing the paired pictures as similar pictures into a database so as to support a picture recommendation algorithm. For example: as shown in fig. 13, a folder "hospital application" is newly created, and 4 picture files are extracted and named for the slide shown in fig. 11. The 'picture search word' is obtained using a fast word segmentation method. All pictures are traversed, every two pictures with the same search word are paired and stored in a database as similar pictures to support a picture recommendation algorithm, and the final result can be shown in an example shown in fig. 14.
Corresponding to step 6, step 6 may be performed using the picture storage module 6 during actual use. The operations performed by the picture storing module 6 can refer to the related description of step 6, and are not described herein again.
Therefore, according to the scheme of the invention, the method for automatically matching the pictures and texts in the slides and naming the pictures can compare the characteristics of randomness but strong correlation aiming at the position relation between the pictures and the text contents in each slide, accurately match the pictures and the text blocks through an intelligent algorithm according to the geometric position information, and is used for naming the pictures, so that the readability, the understandability and the retrievability of the picture names in the slides can be enhanced. The method adopts a natural language analysis method to simplify the associated text of the picture into short and representative subject words, and is convenient for establishing indexes and quickly searching.
Specifically, the scheme of the invention adopts an algorithm based on the text font bounding box and the semantic score, and solves the problem that the most relevant text is accurately matched for each picture under the conditions that the positions of text blocks are changeable and a plurality of pictures exist. According to the scheme of the invention, firstly, the correlation between the pictures in the slide and the characters on the page in the space position is calculated; then, a keyword and trivial word matching method is adopted to score and quantify key semantic information, so that the technical effects of more accurately corresponding the picture with the slide text block and greatly enhancing the readability and the understandability of the picture naming are achieved.
Furthermore, the scheme of the invention adopts natural language analysis algorithms such as Chinese word segmentation and TextRank, and solves the problems that some technologies for marking pictures are not suitable for long texts and are limited to short and small special name words. According to the scheme, firstly, subject words of each page of a slide and full text corpus are subjected to natural language analysis, then associated texts of each picture are directly subjected to natural language analysis, and finally, the associated texts are simplified into short and representative file names by combining semantics and slide subjects; not only can proper nouns such as names of people and place names be extracted, but also long sections of subject terms can be extracted, and the subject terms can correspond to the subjects of the slides.
Since the processes and functions implemented by the terminal of this embodiment substantially correspond to the embodiments, principles, and examples of the apparatus shown in fig. 9, reference may be made to the related descriptions in the foregoing embodiments for details which are not described in detail in the description of this embodiment, and no further description is given here.
Through a large number of tests, the technical scheme of the invention is adopted, the position relation of the pictures and the character contents in each slide is compared with the characteristics of randomness but strong correlation, the pictures and the text blocks are accurately matched through an intelligent algorithm according to the geometric position information, the corresponding relation between a plurality of pictures and a plurality of text information in each page of the engineering slide can be conveniently determined, and the user can conveniently search and use the engineering slide.
According to an embodiment of the present invention, there is also provided a storage medium corresponding to a method for processing pictures and texts in a slide show, where the storage medium includes a stored program, and when the program runs, a device on which the storage medium is located is controlled to execute the method for processing pictures and texts in a slide show.
Since the processing and functions implemented by the storage medium of this embodiment substantially correspond to the embodiments, principles, and examples of the methods shown in fig. 1 to 8, the description of this embodiment is not detailed, and reference may be made to the related descriptions in the foregoing embodiments, which are not described herein again.
Through a large number of tests, the technical scheme of the invention is adopted, and aiming at the position relation between the pictures and the text contents in each page of slide, the algorithm based on the text font size bounding box and the semantic score is adopted, so that the most relevant text can be accurately matched for each picture under the condition that the positions of the text blocks are changeable and a plurality of pictures exist, thereby quickly determining the corresponding relation between the plurality of pictures and a plurality of text information in each page of the engineering slide, and facilitating the retrieval and use of users.
According to an embodiment of the present invention, there is also provided a processor corresponding to a method for processing pictures and texts in a slide show, the processor being configured to execute a program, wherein the program executes the method for processing pictures and texts in a slide show.
Since the processing and functions implemented by the processor of this embodiment substantially correspond to the embodiments, principles, and examples of the methods shown in fig. 1 to 8, the description of this embodiment is not detailed, and reference may be made to the related descriptions in the foregoing embodiments, which are not described herein again.
Through a large number of tests, by adopting the technical scheme of the invention, aiming at the position relation between the pictures and the text contents in each slide, in the process of determining the corresponding relation between a plurality of pictures and a plurality of text information in each page of the engineering slide, Chinese word segmentation, TextRank and other natural language analysis algorithms are adopted, so that not only can special nouns such as names of people and place names be extracted, but also longer sections of subject terms can be extracted, and the subject terms can correspond to the subjects of the slides, and the application range is wider.
In summary, it is readily understood by those skilled in the art that the advantageous modes described above can be freely combined and superimposed without conflict.
The above description is only an example of the present invention, and is not intended to limit the present invention, and it is obvious to those skilled in the art that various modifications and variations can be made in the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.

Claims (10)

1. A method for processing pictures and texts in a slide is characterized by comprising the following steps:
determining picture information and text information of each page of slide in the slide file;
carrying out natural language analysis processing on the text information of all page slides in the slide file to obtain named text sentences of all page slides in the slide file;
matching a named text sentence for each picture in the slide file according to the picture information in the slide file and the named text sentence of the slide file to obtain a picture named text sentence of each picture;
establishing a corresponding relation between the picture information and the text information in the slide file according to the picture information in the slide file and the picture naming text sentence obtained by matching each picture;
the picture information of each page of slide in the slide file comprises: the width and height of each page of slide, and the picture bounding box information of each picture in each page of slide; text information for each slide in the slide file, including: the text content, font size, and/or text bounding box information of all text statements of each slide.
2. The method of claim 1, wherein the step of processing the pictures and texts in the slide show,
determining picture information and text information of each page of slide in the slide file, including:
aiming at each page of slide in the slide file, acquiring the width and height of each page of slide, and acquiring the picture bounding box information of each picture in each page of slide as the picture information of each page of slide in the slide file; and the number of the first and second groups,
acquiring text contents, word sizes and/or text bounding box information of all text sentences in each page of slide as text information of each page of slide in the slide file;
and/or the presence of a gas in the gas,
the method for analyzing and processing the text information of all pages of slides in the slide file by natural language comprises the following steps:
determining each page of corpus information of each page of slides in the slide file and full text corpus information of all pages of slides in the slide file based on the text information of all pages of slides in the slide file;
performing natural language analysis processing on each page of corpus information and full-text corpus information to obtain a subject word set and a trivial word set of each page of slide, and a full-text subject word set and a full-text trivial word set of all pages of slides;
determining named file sentences of all text information in the slide file based on the subject word set and the trivial word set of each page of the slide, and the full-text subject word set and the full-text trivial word set of all pages of the slide;
and/or the presence of a gas in the gas,
establishing a corresponding relation between the picture information and the text information in the slide file, comprising the following steps:
and naming a text sentence aiming at the picture of each picture in each page of slide in the slide file, constructing a storage result for each picture, and storing each picture according to the storage result.
3. The method of claim 2, wherein the step of processing the pictures and texts in the slide show,
determining corpus information of each page of each slide in the slide file and full text corpus information of all pages of slides in the slide file, including:
connecting the text information of each page of slide in the slide file according to a first set sequence to form each page of corpus information of each page of slide; and the number of the first and second groups,
the method comprises the steps that for text information of all page slides in a slide file, text information which repeatedly appears at the same position in different page slides is removed, and corrected text information of all page slides is obtained; connecting the corrected text information of all the page slides according to a second set sequence to form full text corpus information of all the page slides;
and/or the presence of a gas in the gas,
carry out natural language analysis to every page corpus information and full text corpus information and handle, include:
performing Chinese word segmentation processing on each page of corpus information and each corpus information in the full-text corpus information by using an N shortest path word segmentation algorithm to obtain word segmentation results; in the word segmentation result, the sentence in each corpus information is segmented into words and phrases with set specifications and set proper nouns to obtain segmented words;
selecting a set number of words in the word segmentation result of each corpus according to a set score sequence by using a TextRank algorithm to serve as a subject word set of the corpus;
dividing the words in the corpus which meet the standard of the trivial words into the trivial word set of the corpus;
and/or the presence of a gas in the gas,
determining named file statements of all text information in the slide file, including:
determining the text content with the maximum word size in the part, in which the minimum Y-direction data in the text bounding box information of each picture in each page of slide is larger than the set coefficient times of the height of each picture, as the named text sentence of the picture in the page of slide according to the word size and the text bounding box information in the text information of each page of slide in the slide file; analogizing in sequence to obtain named text sentences of all pictures in all pages of slides in the slide file, wherein the named text sentences are used as named file sentences of all text information in the slide file;
and/or the presence of a gas in the gas,
matching named text sentences for each picture in the slide file, comprising:
determining all named text sentences of the picture in a set direction range according to the picture bounding box information in the picture information of each picture in each page of slide so as to obtain all named text sentences of the picture;
if all named text sentences of the picture are empty, determining the named text sentences of the slide of the page where the picture is located as the named text sentences of the picture;
if all the named text sentences of the picture are not empty, determining the weight according to all the named text sentences of the picture, and determining the matching result of the picture and all the named text sentences according to all the named text sentences of the picture; and the number of the first and second groups,
determining the named text sentence corresponding to the maximum one as the named text sentence matched with the picture according to the maximum one in the sum of the weight of the picture and the matching result of the picture, and taking the named text sentence as the picture named text sentence of the picture;
and/or the presence of a gas in the gas,
constructing a storage result for each picture, and storing each picture according to the storage result, wherein the method comprises the following steps:
aiming at each page of slide, a folder is newly built and named by the named text sentence of the page of slide; independently storing each picture as an independent file, naming the independent file of each picture by using the picture naming text sentence of each picture, and then placing the independent file into the new folder;
establishing a storage record for the picture in a database; and in the storage record of the picture, determining and storing the picture full name field of the picture according to the picture naming text sentence of the picture.
4. The method of claim 3, wherein the step of processing the pictures and texts in the slide show,
determining the weight according to all named text sentences of the picture, wherein the method comprises the following steps:
calculating the weight according to the word size of each named text sentence in all the named text sentences of the picture, the distance between each named text sentence of the picture and the central point of the picture and the overlapping length between each named text sentence of the picture and the picture
Figure FDA0002528793010000041
Wherein:
Figure FDA0002528793010000042
Figure FDA0002528793010000043
djis the distance between each named text sentence of the picture and the center point of the picture, ljThe overlapping length between each named text sentence of the picture and the picture is obtained;
and/or the presence of a gas in the gas,
determining the matching result of the picture and all named text sentences according to all named text sentences of the picture, wherein the matching result comprises the following steps:
matching the word segmentation words in each named text sentence of the picture with the subject word set and the trivial word set of each page of the page where the picture is located, and the full-text subject word set and the full-text trivial word set of all the pages of the slides in sequence to obtain a matching result;
and/or the presence of a gas in the gas,
determining and storing the picture full name field of the picture according to the picture naming text sentence of the picture, wherein the method comprises the following steps:
if the length of the Chinese character in the picture naming text sentence of the picture is less than or equal to a preset value, directly storing the picture naming text sentence of the picture as a picture full name field of the picture;
if the length of the Chinese character in the picture naming text sentence of the picture is larger than a preset value, extracting a set phrase in the picture naming text sentence of the picture by using an information entropy algorithm, and taking the set phrase as a new picture naming text sentence of the picture; storing a new picture naming text statement of the picture as a picture full name field of the picture;
determining the picture full name field of the picture as the search engine word segmentation of the picture by using a rapid word segmentation method, and storing the search engine word segmentation as the picture search word of the picture;
and traversing all the pictures in the slide file, pairing a plurality of pictures with the same picture search word, and storing the paired pictures as similar pictures in a database.
5. An apparatus for processing pictures and text in a slide, comprising:
the determining unit is used for determining the picture information and the text information of each page of slide in the slide file;
the processing unit is used for carrying out natural language analysis processing on the text information of all the page slides in the slide file to obtain named text sentences of all the page slides in the slide file;
the processing unit is also used for matching a named text statement for each picture in the slide file according to the picture information in the slide file and the named text statement of the slide file to obtain a picture named text statement of each picture;
the processing unit is also used for establishing a corresponding relation between the picture information and the text information in the slide file according to the picture information in the slide file and the picture naming text sentence obtained by matching each picture;
the picture information of each page of slide in the slide file comprises: the width and height of each page of slide, and the picture bounding box information of each picture in each page of slide; text information for each slide in the slide file, including: the text content, font size, and/or text bounding box information of all text statements of each slide.
6. The apparatus for processing pictures and texts in slides of claim 5, wherein,
the determining unit determines picture information and text information of each page of slide in the slide file, including:
aiming at each page of slide in the slide file, acquiring the width and height of each page of slide, and acquiring the picture bounding box information of each picture in each page of slide as the picture information of each page of slide in the slide file; and the number of the first and second groups,
acquiring text contents, word sizes and/or text bounding box information of all text sentences in each page of slide as text information of each page of slide in the slide file;
and/or the presence of a gas in the gas,
the processing unit carries out natural language analysis processing on the text information of all page slides in the slide file, and the processing unit comprises the following steps:
determining each page of corpus information of each page of slides in the slide file and full text corpus information of all pages of slides in the slide file based on the text information of all pages of slides in the slide file;
performing natural language analysis processing on each page of corpus information and full-text corpus information to obtain a subject word set and a trivial word set of each page of slide, and a full-text subject word set and a full-text trivial word set of all pages of slides;
determining named file sentences of all text information in the slide file based on the subject word set and the trivial word set of each page of the slide, and the full-text subject word set and the full-text trivial word set of all pages of the slide;
and/or the presence of a gas in the gas,
the processing unit establishes a corresponding relationship between the picture information and the text information in the slide file, and comprises the following steps:
and naming a text sentence aiming at the picture of each picture in each page of slide in the slide file, constructing a storage result for each picture, and storing each picture according to the storage result.
7. The apparatus for processing pictures and texts in slides of claim 6, wherein,
the processing unit determines the corpus information of each page of the slides in the slide file and the full text corpus information of all pages of the slides in the slide file, and the method comprises the following steps:
connecting the text information of each page of slide in the slide file according to a first set sequence to form each page of corpus information of each page of slide; and the number of the first and second groups,
the method comprises the steps that for text information of all page slides in a slide file, text information which repeatedly appears at the same position in different page slides is removed, and corrected text information of all page slides is obtained; connecting the corrected text information of all the page slides according to a second set sequence to form full text corpus information of all the page slides;
and/or the presence of a gas in the gas,
the processing unit carries out natural language analysis processing to each page of corpus information and full text corpus information, and the processing unit comprises:
performing Chinese word segmentation processing on each page of corpus information and each corpus information in the full-text corpus information by using an N shortest path word segmentation algorithm to obtain word segmentation results; in the word segmentation result, the sentence in each corpus information is segmented into words and phrases with set specifications and set proper nouns to obtain segmented words;
selecting a set number of words in the word segmentation result of each corpus according to a set score sequence by using a TextRank algorithm to serve as a subject word set of the corpus;
dividing the words in the corpus which meet the standard of the trivial words into the trivial word set of the corpus;
and/or the presence of a gas in the gas,
the processing unit determines named file statements of all text information in the slide file, including:
determining the text content with the maximum word size in the part, in which the minimum Y-direction data in the text bounding box information of each picture in each page of slide is larger than the set coefficient times of the height of each picture, as the named text sentence of the picture in the page of slide according to the word size and the text bounding box information in the text information of each page of slide in the slide file; analogizing in sequence to obtain named text sentences of all pictures in all pages of slides in the slide file, wherein the named text sentences are used as named file sentences of all text information in the slide file;
and/or the presence of a gas in the gas,
the processing unit matches named text sentences for each picture in the slide file, and comprises the following steps:
determining all named text sentences of the picture in a set direction range according to the picture bounding box information in the picture information of each picture in each page of slide so as to obtain all named text sentences of the picture;
if all named text sentences of the picture are empty, determining the named text sentences of the slide of the page where the picture is located as the named text sentences of the picture;
if all the named text sentences of the picture are not empty, determining the weight according to all the named text sentences of the picture, and determining the matching result of the picture and all the named text sentences according to all the named text sentences of the picture; and the number of the first and second groups,
determining the named text sentence corresponding to the maximum one as the named text sentence matched with the picture according to the maximum one in the sum of the weight of the picture and the matching result of the picture, and taking the named text sentence as the picture named text sentence of the picture;
and/or the presence of a gas in the gas,
the processing unit constructs a storage result for each picture, and stores each picture according to the storage result, and the method comprises the following steps:
aiming at each page of slide, a folder is newly built and named by the named text sentence of the page of slide; independently storing each picture as an independent file, naming the independent file of each picture by using the picture naming text sentence of each picture, and then placing the independent file into the new folder;
establishing a storage record for the picture in a database; and in the storage record of the picture, determining and storing the picture full name field of the picture according to the picture naming text sentence of the picture.
8. The apparatus for processing pictures and texts in slides of claim 7, wherein,
the processing unit determines the weight according to all the named text sentences of the picture, and the method comprises the following steps:
calculating the weight according to the word size of each named text sentence in all the named text sentences of the picture, the distance between each named text sentence of the picture and the central point of the picture and the overlapping length between each named text sentence of the picture and the picture
Figure FDA0002528793010000081
Wherein:
Figure FDA0002528793010000082
Figure FDA0002528793010000083
djis the distance between each named text sentence of the picture and the center point of the picture, ljThe overlapping length between each named text sentence of the picture and the picture is obtained;
and/or the presence of a gas in the gas,
the processing unit determines matching results of the picture and all named text sentences according to all named text sentences of the picture, and the matching results comprise:
matching the word segmentation words in each named text sentence of the picture with the subject word set and the trivial word set of each page of the page where the picture is located, and the full-text subject word set and the full-text trivial word set of all the pages of the slides in sequence to obtain a matching result;
and/or the presence of a gas in the gas,
the processing unit determines and stores the picture full name field of the picture according to the picture naming text sentence of the picture, and the processing unit comprises:
if the length of the Chinese character in the picture naming text sentence of the picture is less than or equal to a preset value, directly storing the picture naming text sentence of the picture as a picture full name field of the picture;
if the length of the Chinese character in the picture naming text sentence of the picture is larger than a preset value, extracting a set phrase in the picture naming text sentence of the picture by using an information entropy algorithm, and taking the set phrase as a new picture naming text sentence of the picture; storing a new picture naming text statement of the picture as a picture full name field of the picture;
determining the picture full name field of the picture as the search engine word segmentation of the picture by using a rapid word segmentation method, and storing the search engine word segmentation as the picture search word of the picture;
and traversing all the pictures in the slide file, pairing a plurality of pictures with the same picture search word, and storing the paired pictures as similar pictures in a database.
9. A terminal, comprising: processing means of pictures and text in a slide show according to any of claims 5 to 8;
alternatively, it comprises:
a processor for executing a plurality of instructions;
a memory to store a plurality of instructions;
wherein the instructions are for being stored by the memory and loaded and executed by the processor to perform the method of processing pictures and text in a slide show according to any one of claims 1 to 4.
10. A storage medium having a plurality of instructions stored therein; the instructions for loading and executing the method of processing pictures and text in a slide show according to any one of claims 1 to 4 by a processor.
CN202010512421.8A 2020-06-08 2020-06-08 Method and device for processing pictures and texts in slide, terminal and storage medium Active CN111681301B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010512421.8A CN111681301B (en) 2020-06-08 2020-06-08 Method and device for processing pictures and texts in slide, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010512421.8A CN111681301B (en) 2020-06-08 2020-06-08 Method and device for processing pictures and texts in slide, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN111681301A true CN111681301A (en) 2020-09-18
CN111681301B CN111681301B (en) 2023-05-09

Family

ID=72435511

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010512421.8A Active CN111681301B (en) 2020-06-08 2020-06-08 Method and device for processing pictures and texts in slide, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN111681301B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101510221A (en) * 2009-02-17 2009-08-19 北京大学 Enquiry statement analytical method and system for information retrieval
WO2017197593A1 (en) * 2016-05-18 2017-11-23 Nokia Technologies Oy Apparatus, method and computer program product for recovering editable slide

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101510221A (en) * 2009-02-17 2009-08-19 北京大学 Enquiry statement analytical method and system for information retrieval
WO2017197593A1 (en) * 2016-05-18 2017-11-23 Nokia Technologies Oy Apparatus, method and computer program product for recovering editable slide

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
亢娟娜;: "基于Word VBA的幻灯片打印模板制作", 中国包装工业 *

Also Published As

Publication number Publication date
CN111681301B (en) 2023-05-09

Similar Documents

Publication Publication Date Title
CN110502621B (en) Question answering method, question answering device, computer equipment and storage medium
CN112035730B (en) Semantic retrieval method and device and electronic equipment
CN107436864B (en) Chinese question-answer semantic similarity calculation method based on Word2Vec
CN112650840A (en) Intelligent medical question-answering processing method and system based on knowledge graph reasoning
CN110750995B (en) File management method based on custom map
CN105956053B (en) A kind of search method and device based on network information
CN111428494A (en) Intelligent error correction method, device and equipment for proper nouns and storage medium
CN108763529A (en) A kind of intelligent search method, device and computer readable storage medium
CN118377783B (en) SQL sentence generation method and device
CN104077346A (en) Document creation support apparatus, method and program
CN112434211B (en) Data processing method, device, storage medium and equipment
CN116881425A (en) Universal document question-answering implementation method, system, device and storage medium
US20140149106A1 (en) Categorization Based on Word Distance
CN118917305A (en) RAG system optimization method, system, electronic equipment and storage medium
CN117407502A (en) Question-answer pair extraction method and device, electronic equipment and storage medium
CN118377853B (en) Paper topic selection assistance method, system, medium and equipment based on large language model
EP2544100A2 (en) Method and system for making document modules
CN114595379B (en) Intelligent recommendation method and device for data standard
JP2009199302A (en) Program, device, and method for analyzing document
CN120045696A (en) Search enhancement generation method based on dynamic document block optimization
CN116662583B (en) Text generation method, place retrieval method and related devices
CN111681301A (en) Method, device, terminal and storage medium for processing pictures and texts in slides
CN112269852B (en) Method, system and storage medium for generating public opinion themes
CN118152555A (en) Content summary generation method, device and equipment
JP2002183195A (en) Concept search method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant