CN113569567A - Text recognition method and device, computer readable medium and electronic equipment - Google Patents

Text recognition method and device, computer readable medium and electronic equipment Download PDF

Info

Publication number
CN113569567A
CN113569567A CN202110129547.1A CN202110129547A CN113569567A CN 113569567 A CN113569567 A CN 113569567A CN 202110129547 A CN202110129547 A CN 202110129547A CN 113569567 A CN113569567 A CN 113569567A
Authority
CN
China
Prior art keywords
character
type
characters
recognition result
text
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.)
Pending
Application number
CN202110129547.1A
Other languages
Chinese (zh)
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110129547.1A priority Critical patent/CN113569567A/en
Publication of CN113569567A publication Critical patent/CN113569567A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/126Character encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/232Orthographic correction, e.g. spell checking or vowelisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/274Converting codes to words; Guess-ahead of partial word inputs

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Character Discrimination (AREA)

Abstract

The embodiment of the application provides a text recognition method and device, a computer readable medium and electronic equipment. The text recognition method comprises the following steps: extracting characters and acquiring character positions of a text to be recognized so as to obtain a plurality of characters contained in the text to be recognized and positions of the characters in the text to be recognized; acquiring the associated characters of each character based on the set character association relationship; determining a recognition result corresponding to each character according to the associated character of each character and the position of each character in the text to be recognized; and generating a text recognition result aiming at the text to be recognized according to the recognition result corresponding to each character. According to the technical scheme of the embodiment of the application, the accuracy rate of text recognition is improved, and the readability of a text recognition result is ensured.

Description

Text recognition method and device, computer readable medium and electronic equipment
Technical Field
The present application relates to the field of computer and communication technologies, and in particular, to a text recognition method, an apparatus, a computer-readable medium, and an electronic device.
Background
More than 60 nationalities of the world are written on the basis of arabic characters, such as uygur, kazakh and korkmin. Characters written by adopting an Arabic character set, such as Uygur, Kazak, Coerczi and the like, are all composed of 30-40 basic letters, and the basic characters have different variant forms according to different positions appearing in words. In the process of composing words, the basic characters are connected by selecting a suitable variant form.
With the increasing number of characters used, such as Uygur, Kazakh, and Korkinjun, the research on the relevant character recognition technology is also an urgent need for the development of various character information processing systems. However, the existing recognition technology has many problems that recognized letters are not connected, the writing rule is not met, and the recognition result is not readable.
Disclosure of Invention
Embodiments of the present application provide a text recognition method, a text recognition device, a computer-readable medium, and an electronic device, so that at least to a certain extent, the defects of low accuracy, no readability, and the like of a text recognition result can be overcome.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned by practice of the application.
According to an aspect of an embodiment of the present application, there is provided a text recognition method including: extracting characters and acquiring character positions of a text to be recognized so as to obtain a plurality of characters contained in the text to be recognized and positions of the characters in the text to be recognized; acquiring the associated characters of each character based on the set character association relationship; determining a recognition result corresponding to each character according to the associated character of each character and the position of each character in the text to be recognized; and generating a text recognition result aiming at the text to be recognized according to the recognition result corresponding to each character.
According to an aspect of an embodiment of the present application, there is provided a text recognition apparatus including: the processing unit is configured to perform character extraction and character position acquisition on a text to be recognized so as to obtain a plurality of characters contained in the text to be recognized and positions of the characters in the text to be recognized; the acquisition unit is configured to acquire the associated characters of the characters based on the set character association relation; the determining unit is configured to determine a recognition result corresponding to each character according to the associated character of each character and the position of each character in the text to be recognized; and the generating unit is configured to generate a text recognition result aiming at the text to be recognized according to the recognition result corresponding to each character.
In some embodiments of the present application, based on the foregoing scheme, the determining unit is configured to: if a first type character exists in the characters, determining a recognition result corresponding to the first type character according to at least one of a single-body character, a front conjoined character, a double-conjoined character and a rear conjoined character associated with the first type character and the position of the first type character in the text to be recognized based on the position of the first type character in the text to be recognized, wherein the first type character is a character of which the associated character comprises the single-body character, the front conjoined character, the double-conjoined character and the rear conjoined character; the character connection method comprises the steps of obtaining a character connection point, and obtaining a character connection point.
In some embodiments of the present application, based on the foregoing scheme, the determining unit includes: the first determining subunit is configured to determine, if it is determined that characters exist at positions adjacent to the front and back of the first type character according to the position of the first type character in the text to be recognized, a recognition result corresponding to the first type character according to the double-connected character associated with the first type character and the back-connected character associated with the first type character; a second determining subunit, configured to determine, if it is determined that a character exists at a position adjacent to a front position of the first type character according to the position of the first type character in the text to be recognized, and no character exists at a position adjacent to a rear position of the first type character, a recognition result corresponding to the first type character according to the independent character associated with the first type character and the preceding conjoined character associated with the first type character; a third determining subunit, configured to, if it is determined that there is no character at a front adjacent position of the first type character and there is a character at a rear adjacent position according to the position of the first type character in the text to be recognized, take a rear conjoined character associated with the first type character as a recognition result corresponding to the first type character; and the fourth determining subunit is configured to, if it is determined that no character exists at positions adjacent to the front and the back of the first type character according to the position of the first type character in the text to be recognized, take the independent character associated with the first type character as a recognition result corresponding to the first type character.
In some embodiments of the present application, based on the foregoing scheme, the first determining subunit is configured to: acquiring a recognition result corresponding to the character at the front adjacent position of the first type character; if the recognition result corresponding to the character at the front adjacent position of the first type character is the double-connected character or the rear connected character, taking the double-connected character associated with the first type character as the recognition result corresponding to the first type character; and if the recognition result corresponding to the character at the front adjacent position of the first type character is the independent character or the front conjoined character, taking the rear conjoined character associated with the first type character as the recognition result corresponding to the first type character.
In some embodiments of the present application, based on the foregoing scheme, the second determining subunit is configured to: acquiring a recognition result corresponding to the character at the front adjacent position of the first type character; if the recognition result corresponding to the character at the front adjacent position of the first type character is the double-connected character or the rear connected character, taking the front connected character associated with the first type character as the recognition result corresponding to the first type character; and if the recognition result corresponding to the character at the front adjacent position of the first type character is the independent character or the front conjoined character, taking the independent character associated with the first type character as the recognition result corresponding to the first type character.
In some embodiments of the present application, based on the foregoing scheme, the determining unit is configured to: if a second type character exists in the characters, determining a recognition result corresponding to the second type character according to at least one of a solitary character associated with the second type character and a preceding conjoined character associated with the second type character based on the position of the second type character in the text to be recognized, wherein the second type character is a character of which the associated character comprises the solitary character and the preceding conjoined character; the independent character is a character which can not be connected with characters at front and back adjacent positions, and the front conjoined character is a character which is only connected with the characters at the front adjacent positions.
In some embodiments of the present application, based on the foregoing scheme, the determining unit includes: a fifth determining subunit, configured to determine, if it is determined that a character exists at a position adjacent to a front position of the second type character according to the position of the second type character in the text to be recognized, and no character exists at a position adjacent to a rear position, or characters exist at positions adjacent to the front and rear positions of the second type character, a recognition result corresponding to the second type character according to the unicode character associated with the second type character and the preceding conjoined character associated with the second type character; a sixth determining subunit, configured to, if it is determined that there is no character at a position adjacent to a position of the second type character in the text to be recognized according to the position of the second type character, and there is a character at a position adjacent to a position after the position, or there is no character at a position adjacent to a position before and after the position, take a unibody character associated with the second type character as a recognition result corresponding to the second type character.
In some embodiments of the present application, based on the foregoing scheme, the fifth determining subunit is configured to: acquiring a recognition result corresponding to the character at the front adjacent position of the second type character; if the recognition result corresponding to the character at the front adjacent position of the second type character is the double-conjoined character or the rear conjoined character, taking the front conjoined character associated with the second type character as the recognition result corresponding to the second type character; and if the recognition result corresponding to the character at the front adjacent position of the second type character is the independent character or the front conjoined character, taking the independent character associated with the second type character as the recognition result corresponding to the second type character.
In some embodiments of the present application, based on the foregoing scheme, the determining unit is configured to: if a third type character exists in the characters, determining a recognition result corresponding to the third type character according to at least one of a preceding conjoined character and the third type character associated with the third type character based on the position of the third type character in the text to be recognized, wherein the third type character is a character which only contains the preceding conjoined character in the associated characters; and the front conjoined character is a character which is only connected with the character at the front adjacent position.
In some embodiments of the present application, based on the foregoing scheme, the determining unit includes: a seventh determining subunit, configured to determine, if it is determined that a character exists at a position adjacent to a front position of the third type character according to the position of the third type character in the text to be recognized, and no character exists at a position adjacent to a rear position, or characters exist at positions adjacent to the front and rear positions of the third type character, a recognition result corresponding to the third type character according to a preceding conjoined character associated with the third type character and the third type character; and the eighth determining subunit is configured to, if it is determined that no character exists at a position adjacent to the third type character in the front of the text to be recognized and a character exists at a position adjacent to the rear of the text to be recognized or no character exists at a position adjacent to the front of the text to be recognized, directly use the third type character as a recognition result corresponding to the third type character.
In some embodiments of the present application, based on the foregoing scheme, the seventh determining subunit is configured to: acquiring a recognition result corresponding to the character at the front adjacent position of the third type character; if the recognition result corresponding to the character at the front adjacent position of the third type character is the double-conjoined character or the rear conjoined character, taking the front conjoined character associated with the third type character as the recognition result corresponding to the third type character; and if the recognition result corresponding to the character at the front adjacent position of the third type character is the independent character or the front conjoined character, directly taking the third type character as the recognition result corresponding to the third type character.
In some embodiments of the present application, based on the foregoing scheme, the determining unit is configured to: if the associated character does not exist in the target character of the characters, directly taking the target character as a recognition result corresponding to the target character; the generation unit is configured to: adjusting the position of the target character in a plurality of continuous characters to be the first position of the plurality of continuous characters to obtain a new position sequence of the plurality of continuous characters; according to the new position sequence, connecting the target characters and recognition results corresponding to other characters except the target characters in the continuous characters to generate words contained in the text to be recognized; and generating a text recognition result aiming at the text to be recognized according to words contained in the text to be recognized.
According to an aspect of embodiments of the present application, there is provided a computer-readable medium on which a computer program is stored, which computer program, when executed by a processor, implements a text recognition method as described in the above embodiments.
According to an aspect of an embodiment of the present application, there is provided an electronic device including: one or more processors; a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the text recognition method as described in the above embodiments.
According to an aspect of embodiments herein, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the text recognition method provided in the various alternative embodiments described above.
In the technical solutions provided in some embodiments of the present application, character extraction and character position acquisition are performed on a text to be recognized to obtain a plurality of characters contained in the text to be recognized and positions of the characters in the text to be recognized, then associated characters of the characters can be obtained based on a set character association relationship, after the associated characters of the characters are obtained, a recognition result corresponding to each character can be determined according to the associated characters of the characters and the positions of the characters in the text to be recognized, and finally, a text recognition result for the text to be recognized can be generated according to the recognition result corresponding to each character. The technical scheme of the embodiment of the application determines the character recognition rule, namely after a plurality of characters contained in the text to be recognized are obtained, the recognition result corresponding to each character can be determined according to the associated character of each character and the position of each character in the text to be recognized.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 shows a schematic diagram of an exemplary system architecture to which aspects of embodiments of the present application may be applied;
FIG. 2 shows a flow diagram of a text recognition method according to an embodiment of the present application;
FIG. 3 shows a flow diagram of a text recognition method according to an embodiment of the present application;
FIG. 4 shows a flow diagram of a text recognition method according to an embodiment of the present application;
FIG. 5 shows a flow diagram of a text recognition method according to an embodiment of the present application;
FIG. 6 shows a flow diagram of a text recognition method according to an embodiment of the present application;
FIG. 7 shows a character diagram of Kazakstan;
FIG. 8 is a diagram illustrating comparison of recognition results of a text recognition method applied to a Kazakh scene according to an embodiment of the present application;
FIG. 9 shows a block diagram of a text recognition apparatus according to an embodiment of the present application;
FIG. 10 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the subject matter of the present application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the application.
It is to be noted that the terms used in the specification and claims of the present application and the above-described drawings are only for describing the embodiments and are not intended to limit the scope of the present application. It will be understood that the terms "comprises," "comprising," "includes," "including," "has," "having," and the like, when used herein, specify the presence of stated features, integers, steps, operations, elements, components, and/or groups thereof, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It will be further understood that, although the terms first, second, third, etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first element could be termed a second element without departing from the scope of the present invention. Similarly, a second element may be termed a first element. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
It should be noted that: reference herein to "a plurality" means two or more. "and/or" describe the association relationship of the associated objects, meaning that there may be three relationships, e.g., A and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
The embodiment of the present application relates to Artificial Intelligence (AI) and Machine Learning technologies, and is designed based on Natural Language Processing (NLP) and Machine Learning (ML) technologies in the AI.
Artificial intelligence is a theory, method, technique and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use the knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technique of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a manner similar to human intelligence. Artificial intelligence is the research of the design principle and the realization method of various intelligent machines, so that the machines have the functions of perception, reasoning and decision making. The artificial intelligence technology mainly comprises a computer vision technology, a natural language processing technology, machine learning/deep learning and other directions.
With the research and progress of artificial intelligence technology, artificial intelligence is researched and applied in a plurality of fields, such as common smart homes, smart customer service, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, robots, smart medical treatment and the like.
Machine learning is a multi-field cross discipline, and relates to a plurality of disciplines such as probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and the like. The special research on how a computer simulates or realizes the learning behavior of human beings so as to acquire new knowledge or skills and reorganize the existing knowledge structure to continuously improve the performance of the computer. Machine learning is the core of artificial intelligence, is the fundamental approach for computers to have intelligence, and is applied to all fields of artificial intelligence. Machine learning and deep learning generally include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and the like.
The natural language processing technology is an important direction in the fields of computer science and artificial intelligence. It is a research into various theories and methods that enable efficient communication between humans and computers using natural language. Natural language processing is a science integrating linguistics, computer science and mathematics. Therefore, the research in this field will involve natural language, i.e. the language that people use everyday, so it is closely related to the research of linguistics. Natural language processing techniques typically include text processing, semantic understanding, machine translation, robotic question and answer, knowledge mapping, and the like.
Text processing is a main process in natural language processing technology and can be widely applied to various application scenarios. Identifying minority words in text is an important part of text processing. For example, in a text containing Kazakh characters, if the Kazakh characters can be accurately recognized, the text can be correctly understood, and the research and analysis on the text can be facilitated.
Based on this, an embodiment of the present application provides a text recognition method, where character extraction and character position acquisition are performed on a text to be recognized to obtain a plurality of characters contained in the text to be recognized and positions of the characters in the text to be recognized, then associated characters of the characters can be obtained based on a set character association relationship, after the associated characters of the characters are obtained, a recognition result corresponding to each character can be determined according to the associated characters of the characters and the positions of the characters in the text to be recognized, and finally, a text recognition result for the text to be recognized can be generated according to the recognition result corresponding to each character. The technical scheme of the embodiment of the application determines the character recognition rule, namely after a plurality of characters contained in the text to be recognized are obtained, the recognition result corresponding to each character can be determined according to the associated character of each character and the position of each character in the text to be recognized.
Fig. 1 shows a schematic diagram of an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied.
As shown in fig. 1, the system architecture 100 may include a terminal device 102, a network, and a server 104. The network serves as a medium for providing a communication link between the terminal device 102 and the server 104. The network may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The terminal device 102 may be a variety of electronic devices having a display screen including, but not limited to, smart phones, tablet computers, laptop portable computers, desktop computers, and the like. The server 104 may be an independent physical server, and may also be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a web service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.
The text recognition method provided by the embodiment of the present application is generally executed by the server 104, and accordingly, the text recognition apparatus is generally disposed in the server 104. However, it is easily understood by those skilled in the art that the text recognition method provided in the embodiment of the present application may also be executed by the terminal device 102, and accordingly, the text recognition apparatus may also be disposed in the terminal device 102, which is not particularly limited in the exemplary embodiment. For example, in an exemplary embodiment, a user may upload a text to be recognized to the server 104 through the terminal device 102, and the server 104 processes the text by using the text recognition method provided in the embodiment of the present application, and sends an obtained text recognition result to the terminal device 102.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative, and that there may be any number of terminal devices, networks, and servers, as desired for an implementation. For example, server 105 may be a server cluster comprised of multiple servers, or the like.
The implementation details of the technical solution of the embodiment of the present application are set forth in detail below:
fig. 2 shows a flow diagram of a text recognition method according to an embodiment of the present application, which may be performed by a server, which may be the server shown in fig. 1. Referring to fig. 2, the text recognition method at least includes the following steps:
step S210, extracting characters and acquiring character positions of a text to be recognized so as to obtain a plurality of characters contained in the text to be recognized and positions of the characters in the text to be recognized;
s220, acquiring the associated characters of all the characters based on the set character association relation;
step S230, determining a recognition result corresponding to each character according to the associated character of each character and the position of each character in the text to be recognized;
step S240, generating a text recognition result for the text to be recognized according to the recognition result corresponding to each character.
These steps are described in detail below.
In step S210, character extraction and character position acquisition are performed on the text to be recognized, so as to obtain a plurality of characters included in the text to be recognized and positions of the characters in the text to be recognized.
The text to be recognized is the text to be recognized. In this embodiment, the text to be recognized may be a text at least containing characters written on the basis of arabic characters.
Characters written based on Arabic characters may be, for example, Uygur, Kazakh, and Korkii. It should be explained here that characters written by Arabic characters, such as Uygur, Kazak, and Korkey Cumin, are composed of 30-40 basic characters, the basic characters have different variant forms according to the positions of the basic characters, and the basic characters are connected by selecting proper variant forms in the process of composing words.
Since the characters are basic constituent units of the text, in order to recognize the text to be recognized, character extraction and character position acquisition may be performed on the text to be recognized first to obtain a plurality of characters included in the text to be recognized and positions of the characters in the text to be recognized.
In some embodiments, the characters in the text to be recognized may be stored in a form of Unicode code, so that, during the process of extracting the characters from the text to be recognized, the Unicode code in the recognized text to be recognized may be decoded to obtain a plurality of characters included in the text to be recognized, where Unicode is a computer character code and is also called "Unicode" or "ten thousand code". Unicode is generated to solve the limitation of the traditional character encoding scheme, and sets a uniform and unique binary code for each character in each language so as to meet the requirements of cross-language and cross-platform text conversion and processing.
It should be noted that, although the text to be recognized is a text at least including a text written on the basis of arabic characters, the text written on the basis of arabic characters is composed of basic characters, and the basic characters have different variant forms according to the positions appearing in words, and in the process of composing words, the basic characters are connected by selecting appropriate variant forms. However, the process of character extraction is just opposite to the process of word composition, and only in the process of word composition, the basic character is connected by selecting a proper variant form, and conversely, in the process of character extraction, the extracted character is not a variant form, but only a basic character.
It should be further noted that when the characters of the text to be recognized are extracted, the character positions of the text to be recognized may be obtained, where the obtained positions of the characters in the text to be recognized may be understood as the positions of the characters in words to which the characters belong, for example, the characters are located at the beginning of word positions, at the middle of word positions, or at the end of word positions in the words to which the characters belong.
In step S220, the associated character of each character is acquired based on the set character association relationship.
As described above, characters written by arabic characters, such as uygur, kazak, and korkmin, are composed of basic characters, which have different variant forms depending on the position where they appear in words.
Then, it is understood that the basic character or the variant form constituting the text may be preset due to the normative characteristic of the text, for example, the number of the variant forms, the style of the variant forms, and the like may be preset.
Specifically, in this embodiment, after the plurality of characters included in the text to be recognized are extracted and obtained in step S210, the associated character of each character may be obtained based on the set character association relationship, where the obtained associated character is a variant form of the basic character.
In step S230, a recognition result corresponding to each character is determined according to the associated character of each character and the position of each character in the text to be recognized.
In the process of forming the text to be recognized in this embodiment, the characters may select appropriate associated characters to be connected according to different positions appearing in the words, so after the plurality of characters included in the text to be recognized are extracted and obtained in step S210, the plurality of characters cannot be directly connected to obtain the recognition result of the text to be recognized, and what kind of associated characters are selected in the text to be recognized for each extracted character should be further considered to be connected.
Specifically, in this step, in order to determine which associated character is selected to be connected in the text to be recognized, the determination may be performed according to the associated character of each character and the position of each character in the text to be recognized. And determining which associated character selected by each character in the text to be recognized is connected, namely determining the recognition result corresponding to each character.
In an embodiment of the present application, if a target character exists in the plurality of characters included in the text to be recognized through the extraction in step S210, the target character does not have an associated character, in other words, the target character does not select an associated character to be connected in the process of forming a word, and therefore, in this embodiment, the target character can be directly used as a recognition result corresponding to the target character.
In step S240, a text recognition result for the text to be recognized is generated according to the recognition result corresponding to each character.
Specifically, after determining the recognition result corresponding to each character, generating the text recognition result for the text to be recognized according to the recognition result corresponding to each character may specifically include: firstly, according to the position sequence of a plurality of continuous characters, connecting the recognition results corresponding to the continuous characters respectively to generate a plurality of words contained in the text to be recognized; then, a text recognition result for the text to be recognized may be generated from words contained in the text to be recognized. The plurality of continuous characters mean that spaces, punctuation marks or other characters of different types do not exist among the plurality of characters, and the plurality of characters are continuous in position.
In an embodiment of the present application, if a target character exists in a plurality of consecutive characters and the target character does not have a related character, the method may directly use the target character as a recognition result corresponding to the target character, and after obtaining the recognition result corresponding to the target character and the recognition results corresponding to other characters except the target character in the plurality of consecutive characters, generating a text recognition result for the text to be recognized may specifically include: firstly, the position of the target character in a plurality of continuous characters can be adjusted to the first position of the plurality of continuous characters, and a new position sequence of the plurality of continuous characters is obtained; then, according to the new position sequence, the recognition results corresponding to the target character and other characters are connected to generate words contained in the text to be recognized; further, a text recognition result for the text to be recognized may be generated from words contained in the text to be recognized.
Therefore, through the steps, the character recognition rule is determined, namely after the plurality of characters contained in the text to be recognized are obtained, the recognition result corresponding to each character can be determined according to the associated character of each character and the position of each character in the text to be recognized.
In an embodiment of the present application, according to different situations of associated characters of each character, a corresponding manner of determining a recognition result corresponding to each character may be adopted, and specifically, step S230 may specifically include:
if a first type character exists in the plurality of characters, and the first type character is a character in which the associated character includes an independent character, a preceding conjoined character, a doubly-linked character and a following conjoined character, a recognition result corresponding to the first type character can be determined according to at least one of the independent character, the preceding conjoined character, the doubly-linked character and the following conjoined character associated with the first type character based on the position of the first type character in the text to be recognized.
Here, it should be noted that the unigram character refers to a character which cannot be connected to a character at a position adjacent to the character in front and rear, the preceding conjoined character refers to a character which can be connected to a character at a position adjacent to the character in front, the doubly conjoined character refers to a character which can be connected to a character at a position adjacent to the character in front and rear, and the succeeding conjoined character refers to a character which can be connected to a character at a position adjacent to the character in rear.
In an embodiment of the present application, determining, based on a position of a first type character in a text to be recognized, a recognition result corresponding to the first type character according to at least one of a solitary character, a preceding conjoined character, a double conjoined character, and a following conjoined character associated with the first type character may include:
if the characters exist at the front and back adjacent positions of the first type character according to the position of the first type character in the text to be recognized, determining a recognition result corresponding to the first type character according to the double-connected character associated with the first type character and the back-connected character associated with the first type character;
if it is determined that characters exist at front adjacent positions of the first type characters according to the positions of the first type characters in the text to be recognized and no characters exist at rear adjacent positions, determining a recognition result corresponding to the first type characters according to the independent characters associated with the first type characters and the front conjoined characters associated with the first type characters;
if the position of the first type character in the text to be recognized is the position adjacent to the front position of the first type character, and characters exist in the position adjacent to the back position, the back conjoined character associated with the first type character can be used as a recognition result corresponding to the first type character;
if it is determined that no character exists at the front and rear adjacent positions of the first type character according to the position of the first type character in the text to be recognized, the independent character associated with the first type character can be used as a recognition result corresponding to the first type character.
In an embodiment of the present application, as shown in fig. 3, determining, in the embodiment, a recognition result corresponding to a first type character according to a double-conjoined character associated with the first type character and a post-conjoined character associated with the first type character may specifically include steps S310 to S330, which are described as follows:
in step S310, a recognition result corresponding to the character at the front adjacent position of the first type character is acquired.
Because the characters at the positions adjacent to the first type of character can be recognized before the first type of character to obtain the corresponding recognition result, when the recognition result corresponding to the first type of character is determined, the recognition result corresponding to the characters at the positions adjacent to the first type of character can be obtained first.
In step S320, if the recognition result corresponding to the character at the position adjacent to the first type character is a double-connected character or a rear-connected character, the double-connected character associated with the first type character is used as the recognition result corresponding to the first type character.
Specifically, since the double-connected character is a character that can be connected to characters at adjacent positions before and after the double-connected character, the rear-connected character is a character that is connected to a character at an adjacent position after the double-connected character and is not connected to a character at an adjacent position before the double-connected character, if the obtained recognition result corresponding to the character at the adjacent position before the first type character is the double-connected character or the rear-connected character, it is indicated that the recognition result corresponding to the first type character needs to be connected to the recognition result corresponding to the character at the adjacent position before the double-connected character, and therefore, the double-connected character associated with the first type character can be used as the recognition result corresponding to the first type character, and connection to the recognition result corresponding to the character at the adjacent position before the double-connected character is achieved through the double-connected character.
In step S330, if the recognition result corresponding to the character at the position adjacent to the first type character is an independent character or a preceding conjoined character, the succeeding conjoined character associated with the first type character is used as the recognition result corresponding to the first type character.
On the contrary, if the obtained recognition result corresponding to the character at the front adjacent position of the first type character is an independent character or a front conjoined character, it indicates that the recognition result corresponding to the first type character does not need to be connected with the recognition result corresponding to the character at the front adjacent position, so the rear conjoined character associated with the first type character can be used as the recognition result corresponding to the first type character because the rear conjoined character is a character connected with the rear adjacent position and not connected with the front adjacent position.
In an embodiment of the present application, as shown in fig. 4, determining a recognition result corresponding to a first type character according to a solitary character associated with the first type character and a preceding disjunctor character associated with the first type character in the embodiment may specifically include steps S410 to S430, which are described as follows:
in step S410, recognition results corresponding to characters in front adjacent positions of the first type of character are acquired.
In this embodiment, before determining the recognition result corresponding to the first type character according to the independent character associated with the first type character and the preceding connected character associated with the first type character, the recognition result corresponding to the character at the position adjacent to the preceding position of the first type character may be obtained in advance.
In step S420, if the recognition result corresponding to the character at the position adjacent to the first type character is a double-connected character or a rear-connected character, the front-connected character associated with the first type character is used as the recognition result corresponding to the first type character.
As described above, since the double-connected character is a character that can be connected to characters at adjacent positions before and after the double-connected character, and the back-connected character is a character that can be connected to characters at adjacent positions after the double-connected character, if the recognition result corresponding to the character at the adjacent position before the first type character is the double-connected character or the back-connected character, it is indicated that the recognition result corresponding to the first type character needs to be connected to the recognition result corresponding to the character at the adjacent position before the double-connected character, and therefore the front-connected character associated with the first type character can be used as the recognition result corresponding to the first type character, and connection with the character at the adjacent position before the double-connected character can be achieved through the front-connected character.
In step S430, if the recognition result corresponding to the character at the position adjacent to the first type character is the isolated character or the preceding conjoined character, the isolated character associated with the first type character is taken as the recognition result corresponding to the first type character.
If the recognition result corresponding to the character at the front adjacent position of the first type character is the independent character or the front conjoined character, it indicates that the recognition result corresponding to the first type character does not need to be connected with the recognition result corresponding to the character at the front adjacent position, and the independent character associated with the first type character can be used as the recognition result corresponding to the first type character because the independent character is a character which is not connected with the front adjacent position and the rear adjacent position.
In another embodiment of the present application, step S230 may further specifically include: if a second type character containing the unicode character and the preceding conjoined character exists in the associated characters in the plurality of characters, a recognition result corresponding to the second type character can be determined according to at least one of the unicode character associated with the second type character and the preceding conjoined character associated with the second type character based on the position of the second type character in the text to be recognized.
As described above, the unigram character refers to a character which cannot be connected to characters at positions adjacent to the front and rear of the character, and the preceding conjoined character refers to a character which is connected to a character at a position adjacent to the front of the character and is not connected to a character at a position adjacent to the rear of the character.
In an embodiment of the present application, in the above embodiment, based on the position of the second type character in the text to be recognized, determining, according to at least one of a unibody character associated with the second type character and a preceding conjoined character associated with the second type character, a recognition result corresponding to the second type character may specifically include:
if the characters exist at the front adjacent positions of the second type characters according to the positions of the second type characters in the text to be recognized, and the characters do not exist at the rear adjacent positions or the characters exist at the front adjacent positions and the rear adjacent positions of the second type characters, the recognition results corresponding to the second type characters can be determined according to the independent characters related to the second type characters and the front conjoined characters related to the second type characters;
if it is determined that no character exists at the front adjacent position of the second type character according to the position of the second type character in the text to be recognized, and a character exists at the rear adjacent position or no character exists at the front adjacent position and the rear adjacent position of the second type character, the independent character associated with the second type character can be used as the recognition result corresponding to the second type character.
In an embodiment of the present application, as shown in fig. 5, determining, in the embodiment, a recognition result corresponding to a second type character according to a solitary character associated with the second type character and a preceding disjunctor character associated with the second type character may specifically include steps S510 to S530, which are described as follows:
in step S510, a recognition result corresponding to the character at the position adjacent to the second type character is acquired.
Because the characters at the positions adjacent to the front of the second type of character can be recognized before the second type of character to obtain the corresponding recognition result, when the recognition result corresponding to the second type of character is determined, the recognition result corresponding to the characters at the positions adjacent to the front of the second type of character can be obtained.
In step S520, if the recognition result corresponding to the character at the position adjacent to the front of the second type character is a double-connected character or a rear-connected character, the front-connected character associated with the second type character is used as the recognition result corresponding to the second type character.
If the recognition result corresponding to the character at the front adjacent position of the second type character is a double-connected character or a rear-connected character, it is indicated that the recognition result corresponding to the second type character needs to be connected with the recognition result corresponding to the character at the front adjacent position, so that the front-connected character associated with the second type character can be used as the recognition result corresponding to the second type character, and the connection of the recognition results corresponding to the characters at the front adjacent positions is realized through the front-connected character.
In step S530, if the recognition result corresponding to the character at the position adjacent to the second type character is an autostereoscopic character or a preceding conjoined character, the autostereoscopic character associated with the second type character is used as the recognition result corresponding to the second type character.
In this step, if the recognition result corresponding to the character at the front adjacent position of the second type character is an autostereoscopic character or a front conjoined character, it indicates that the recognition result corresponding to the second type character does not need to be connected with the recognition result corresponding to the character at the front adjacent position, and therefore the autostereoscopic character associated with the second type character can be taken as the recognition result corresponding to the second type character because the autostereoscopic character is a character that is not connected with the front adjacent position and the rear adjacent position.
In another embodiment of the present application, step S230 may further specifically include: if the associated characters only contain the third type character of the preceding conjoined character in the plurality of characters, determining the recognition result corresponding to the third type character according to at least one of the preceding conjoined character and the third type character associated with the third type character based on the position of the third type character in the text to be recognized, wherein the preceding conjoined character is a character which is connected with the character at the position adjacent to the front of the character and is not connected with the character at the position adjacent to the rear of the character.
In an embodiment of the present application, in the above embodiment, determining, according to the preceding concatenated characters and the third type characters associated with the third type characters and the position of the third type characters in the text to be recognized, a recognition result corresponding to the third type characters may specifically include:
if the characters exist at the front adjacent positions of the third type characters according to the positions of the third type characters in the text to be recognized, and the characters do not exist at the rear adjacent positions or the characters exist at the front adjacent positions and the rear adjacent positions of the third type characters, the recognition results corresponding to the third type characters can be determined according to the front conjoined characters and the third type characters related to the third type characters;
if it is determined that no character exists at the front adjacent position of the third type character and a character exists at the rear adjacent position or no character exists at the front adjacent position and the rear adjacent position of the third type character according to the position of the third type character in the text to be recognized, the third type character can be directly used as the recognition result corresponding to the third type character.
In an embodiment of the present application, as shown in fig. 6, determining, according to the preceding concatenated characters and the third type characters associated with the third type characters in the embodiment, a recognition result corresponding to the third type characters may specifically include steps S610 to S630, which are described as follows:
in step S610, a recognition result corresponding to a character in a position adjacent to the front of the third type character is acquired.
And acquiring the recognition result corresponding to the character at the front adjacent position of the third type character in advance before determining the recognition result corresponding to the third type character according to the front conjoined character associated with the third type character and the third type character.
In step S620, if the recognition result corresponding to the character at the position adjacent to the front of the third type character is a double-connected character or a rear-connected character, the front-connected character associated with the third type character is used as the recognition result corresponding to the third type character.
If the recognition result corresponding to the character at the front adjacent position of the third type character is a double-connected character or a rear-connected character, it indicates that the recognition result corresponding to the third type character needs to be connected with the recognition result corresponding to the character at the front adjacent position, and therefore, the front-connected character associated with the third type character can be used as the recognition result corresponding to the third type character. In this way, the connection of the recognition results corresponding to the characters at the previously adjacent positions can be realized by using the preceding conjoined characters as the corresponding recognition results.
In step S630, if the recognition result corresponding to the character at the position adjacent to the front of the third type character is an autostereoscopic character or a front conjoined character, the third type character is directly used as the recognition result corresponding to the third type character.
If the recognition result corresponding to the character at the front adjacent position of the third type character is a double-connected character or a rear-connected character, it means that the recognition result corresponding to the third type character does not need to be connected with the recognition result corresponding to the character at the front adjacent position, and therefore, the third type character can be directly used as the recognition result corresponding to the third type character.
The technical scheme of the embodiment of the present application is described in detail below with reference to fig. 7 and 8, taking an example that a text to be recognized is a text of a kazakh language, where fig. 7 shows basic characters of the kazakh language and variant forms of the basic characters, and the variant forms of the basic characters may include a solitary character, a preceding conjoined character, a double conjoined character, and a following conjoined character. The unibody character is a character which can not be connected with characters on adjacent positions in the front and the back, the double-connected character is a character which can be connected with characters on adjacent positions in the front and the back, the front connected character is a character which is only connected with characters on adjacent positions in the front, and the back connected character is a character which is only connected with characters on adjacent positions in the back.
Kazakstan belongs to the Abeltia family, and according to the Kazakstan grammar rule, in the process of forming words, basic characters of Kazakstan can select a proper variant form to be connected. The existing Kazakh recognition technology has the problems that the recognition result does not accord with the writing rule and the recognition result is not readable due to the fact that the capability of judging which variant form is selected for connection of the basic characters is lacked in the recognition process. In contrast, the text recognition method provided by the embodiment of the application can ensure the readability of the recognition result of the Kazakh text, accords with the writing rule of the Kazakh, and is high in recognition accuracy.
In an application scenario where the text to be recognized is a Kazakh text, the method for recognizing the Kazakh text may specifically include the following steps:
s1, extracting characters and acquiring the positions of the characters in the Kazakh text to obtain a plurality of characters contained in the Kazakh text and the positions of the characters in the Kazakh text.
Specifically, although in the process of composing words, the basic characters of Kazakh language are connected by selecting appropriate variant forms. However, the process of character extraction is exactly opposite to the process of word composition, and only in the process of word composition, the basic character is connected with a proper variant form, and conversely, in the process of character extraction, the extracted character is not a variant form, but only a basic character, namely the basic character shown in fig. 7.
And S2, acquiring the associated characters of each character based on the set character association relation.
Because the basic characters have different variant forms according to the positions in the words when Kazakh is written, the set character association relationship is the association relationship between the basic characters of Kazakh and the variant forms corresponding to the basic characters, and the associated characters of each character are obtained, namely the variant forms of the basic characters of Kazakh.
As shown in fig. 7, the variant forms of the basic character may include a solitary character, a preceding conjoined character, a doubly-conjoined character and a secondly-conjoined character, that is, the associated character may include four forms of a solitary character, a preceding conjoined character, a doubly-conjoined character and a secondly-conjoined character, and the associated characters of different basic characters are different, for example, the associated character of the basic character of the serial number 1 has the solitary character of the serial number 1 and the preceding conjoined character of the serial number 34, the associated character of the basic character of the serial number 7 has the solitary character of the serial number 7 and the preceding conjoined character of the serial number 40, and the doubly-conjoined character of the serial number 67 and the secondly-conjoined character of the serial number 88.
And S3, determining the recognition result corresponding to each character according to the associated character of each character and the position of each character in the Kazakh text.
In the writing rule of the Kazakh, in the process of forming words, proper associated characters are selected for connection according to the positions of basic characters in the words, so that after a plurality of characters in the Kazakh text are obtained, the plurality of characters cannot be used as the recognition result of the Kazakh text, and the selected associated characters in the Kazakh text of the extracted characters are further considered for connection. Specifically, the recognition result corresponding to each character can be determined according to the associated character of each character and the position of each character in the kazakh text, that is, the associated character selected by each character in the kazakh text is determined to be connected.
By way of example, as shown in figure 8,FIG. 8A shows Kazakh text
Figure BDA0002924999230000201
FIG. 8B shows the Kazakh text obtained by step S1
Figure BDA0002924999230000202
Three characters contained in
Figure BDA0002924999230000203
Figure BDA0002924999230000204
These three characters are located at the beginning, middle and end of the word (it is explained here that the writing of Kazakh is from right to left), and FIG. 8C is the associated character of the three characters obtained in step S2.
After obtaining the plurality of characters in the kazakh text, the plurality of characters cannot be used as the recognition result of the kazakh text, and fig. 8D shows an erroneous recognition result. In the embodiment of the present application, it is further required to determine the recognition result corresponding to each character, for example, according to the first character
Figure BDA0002924999230000211
First word position and first character
Figure BDA0002924999230000212
Associated character of
Figure BDA0002924999230000213
Figure BDA0002924999230000214
The back conjoined character contained in the associated character can be used
Figure BDA0002924999230000215
As the first character
Figure BDA0002924999230000216
Corresponding recognition results; according to the second character
Figure BDA0002924999230000217
Position in the word and second character
Figure BDA0002924999230000218
Associated character of
Figure BDA0002924999230000219
Double-connected character contained in associated character
Figure BDA00029249992300002110
As a second character
Figure BDA00029249992300002111
Corresponding recognition results; according to the third character
Figure BDA00029249992300002112
The position of the end of word and the third character
Figure BDA00029249992300002113
Associated character of
Figure BDA00029249992300002114
Corresponding recognition result, the front conjoined character contained in the associated character
Figure BDA00029249992300002115
As a third character
Figure BDA00029249992300002116
And (4) corresponding recognition results.
And S4, generating a text recognition result aiming at the Kazakh text according to the recognition result corresponding to each character.
Continuing with the example of FIG. 7, the first character is obtained in step S3
Figure BDA00029249992300002117
Corresponding recognition result
Figure BDA00029249992300002118
Second character
Figure BDA00029249992300002119
Corresponding recognition result
Figure BDA00029249992300002120
Third character
Figure BDA00029249992300002121
Corresponding recognition result
Figure BDA00029249992300002122
Then, the recognition results corresponding to the respective characters may be connected according to the position order, so as to obtain the correct recognition result as shown in fig. 8E.
Embodiments of the apparatus of the present application are described below, which may be used to perform the text recognition methods in the above-described embodiments of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the text recognition method described above in the present application.
FIG. 9 shows a block diagram of a text recognition apparatus according to an embodiment of the present application.
Referring to fig. 9, a text recognition apparatus 900 according to an embodiment of the present application includes: the processing unit 902 is configured to perform character extraction and character position acquisition on a text to be recognized, so as to obtain a plurality of characters included in the text to be recognized and positions of the characters in the text to be recognized; an obtaining unit 904 configured to obtain associated characters of the respective characters based on the set character association relationship; a determining unit 906, configured to determine, according to the associated character of each character and the position of each character in the text to be recognized, a recognition result corresponding to each character; a generating unit 908 configured to generate a text recognition result for the text to be recognized according to the recognition result corresponding to each character.
In some embodiments of the present application, the determining unit 906 is configured to: if a first type character exists in the characters, determining a recognition result corresponding to the first type character according to at least one of a single-body character, a front conjoined character, a double-conjoined character and a rear conjoined character associated with the first type character and the position of the first type character in the text to be recognized based on the position of the first type character in the text to be recognized, wherein the first type character is a character of which the associated character comprises the single-body character, the front conjoined character, the double-conjoined character and the rear conjoined character; the character connection method comprises the steps of obtaining a character connection point, and obtaining a character connection point.
In some embodiments of the present application, the determining unit 906 comprises: the first determining subunit is configured to determine, if it is determined that characters exist at positions adjacent to the front and back of the first type character according to the position of the first type character in the text to be recognized, a recognition result corresponding to the first type character according to the double-connected character associated with the first type character and the back-connected character associated with the first type character; a second determining subunit, configured to determine, if it is determined that a character exists at a position adjacent to a front position of the first type character according to the position of the first type character in the text to be recognized, and no character exists at a position adjacent to a rear position of the first type character, a recognition result corresponding to the first type character according to the independent character associated with the first type character and the preceding conjoined character associated with the first type character; a third determining subunit, configured to, if it is determined that there is no character at a front adjacent position of the first type character and there is a character at a rear adjacent position according to the position of the first type character in the text to be recognized, take a rear conjoined character associated with the first type character as a recognition result corresponding to the first type character; and the fourth determining subunit is configured to, if it is determined that no character exists at positions adjacent to the front and the back of the first type character according to the position of the first type character in the text to be recognized, take the independent character associated with the first type character as a recognition result corresponding to the first type character.
In some embodiments of the present application, the first determining subunit is configured to: acquiring a recognition result corresponding to the character at the front adjacent position of the first type character; if the recognition result corresponding to the character at the front adjacent position of the first type character is the double-connected character or the rear connected character, taking the double-connected character associated with the first type character as the recognition result corresponding to the first type character; and if the recognition result corresponding to the character at the front adjacent position of the first type character is the independent character or the front conjoined character, taking the rear conjoined character associated with the first type character as the recognition result corresponding to the first type character.
In some embodiments of the present application, the second determining subunit is configured to: acquiring a recognition result corresponding to the character at the front adjacent position of the first type character; if the recognition result corresponding to the character at the front adjacent position of the first type character is the double-connected character or the rear connected character, taking the front connected character associated with the first type character as the recognition result corresponding to the first type character; and if the recognition result corresponding to the character at the front adjacent position of the first type character is the independent character or the front conjoined character, taking the independent character associated with the first type character as the recognition result corresponding to the first type character.
In some embodiments of the present application, the determining unit 906 is configured to: if a second type character exists in the characters, determining a recognition result corresponding to the second type character according to at least one of a solitary character associated with the second type character and a preceding conjoined character associated with the second type character based on the position of the second type character in the text to be recognized, wherein the second type character is a character of which the associated character comprises the solitary character and the preceding conjoined character; the independent character is a character which can not be connected with characters at front and back adjacent positions, and the front conjoined character is a character which is only connected with the characters at the front adjacent positions.
In some embodiments of the present application, the determining unit 906 comprises: a fifth determining subunit, configured to determine, if it is determined that a character exists at a position adjacent to a front position of the second type character according to the position of the second type character in the text to be recognized, and no character exists at a position adjacent to a rear position, or characters exist at positions adjacent to the front and rear positions of the second type character, a recognition result corresponding to the second type character according to the unicode character associated with the second type character and the preceding conjoined character associated with the second type character; a sixth determining subunit, configured to, if it is determined that there is no character at a position adjacent to a position of the second type character in the text to be recognized according to the position of the second type character, and there is a character at a position adjacent to a position after the position, or there is no character at a position adjacent to a position before and after the position, take a unibody character associated with the second type character as a recognition result corresponding to the second type character.
In some embodiments of the present application, the fifth determining subunit is configured to: acquiring a recognition result corresponding to the character at the front adjacent position of the second type character; if the recognition result corresponding to the character at the front adjacent position of the second type character is the double-conjoined character or the rear conjoined character, taking the front conjoined character associated with the second type character as the recognition result corresponding to the second type character; and if the recognition result corresponding to the character at the front adjacent position of the second type character is the independent character or the front conjoined character, taking the independent character associated with the second type character as the recognition result corresponding to the second type character.
In some embodiments of the present application, the determining unit 906 is configured to: if a third type character exists in the characters, determining a recognition result corresponding to the third type character according to at least one of a preceding conjoined character and the third type character associated with the third type character based on the position of the third type character in the text to be recognized, wherein the third type character is a character which only contains the preceding conjoined character in the associated characters; and the front conjoined character is a character which is only connected with the character at the front adjacent position.
In some embodiments of the present application, the determining unit 906 comprises: a seventh determining subunit, configured to determine, if it is determined that a character exists at a position adjacent to a front position of the third type character according to the position of the third type character in the text to be recognized, and no character exists at a position adjacent to a rear position, or characters exist at positions adjacent to the front and rear positions of the third type character, a recognition result corresponding to the third type character according to a preceding conjoined character associated with the third type character and the third type character; and the eighth determining subunit is configured to, if it is determined that no character exists at a position adjacent to the third type character in the front of the text to be recognized and a character exists at a position adjacent to the rear of the text to be recognized or no character exists at a position adjacent to the front of the text to be recognized, directly use the third type character as a recognition result corresponding to the third type character.
In some embodiments of the present application, the seventh determining subunit is configured to: acquiring a recognition result corresponding to the character at the front adjacent position of the third type character; if the recognition result corresponding to the character at the front adjacent position of the third type character is the double-conjoined character or the rear conjoined character, taking the front conjoined character associated with the third type character as the recognition result corresponding to the third type character; and if the recognition result corresponding to the character at the front adjacent position of the third type character is the independent character or the front conjoined character, directly taking the third type character as the recognition result corresponding to the third type character.
In some embodiments of the present application, the determining unit 906 is configured to: if the associated character does not exist in the target character of the characters, directly taking the target character as a recognition result corresponding to the target character; the generating unit 908 is configured to: adjusting the position of the target character in a plurality of continuous characters to be the first position of the plurality of continuous characters to obtain a new position sequence of the plurality of continuous characters; according to the new position sequence, connecting the target characters and recognition results corresponding to other characters except the target characters in the continuous characters to generate words contained in the text to be recognized; and generating a text recognition result aiming at the text to be recognized according to words contained in the text to be recognized.
FIG. 10 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
It should be noted that the computer system 1000 of the electronic device shown in fig. 10 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 10, the computer system 1000 includes a Central Processing Unit (CPU)1001 that can perform various appropriate actions and processes, such as performing the methods described in the above embodiments, according to a program stored in a Read-Only Memory (ROM) 1002 or a program loaded from a storage portion 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data necessary for system operation are also stored. The CPU 1001, ROM 1002, and RAM 1003 are connected to each other via a bus 1004. An Input/Output (I/O) interface 1005 is also connected to the bus 1004.
The following components are connected to the I/O interface 1005: an input section 1006 including a keyboard, a mouse, and the like; an output section 1007 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage portion 1008 including a hard disk and the like; and a communication section 1009 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 1009 performs communication processing via a network such as the internet. The driver 1010 is also connected to the I/O interface 1005 as necessary. A removable medium 1011 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1010 as necessary, so that a computer program read out therefrom is mounted into the storage section 1008 as necessary.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication part 1009 and/or installed from the removable medium 1011. When the computer program is executed by a Central Processing Unit (CPU)1001, various functions defined in the system of the present application are executed.
It should be noted that the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a portable Compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with a computer program embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by an electronic device, cause the electronic device to implement the method described in the above embodiments.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (15)

1. A method of text recognition, the method comprising:
extracting characters and acquiring character positions of a text to be recognized so as to obtain a plurality of characters contained in the text to be recognized and positions of the characters in the text to be recognized;
acquiring the associated characters of each character based on the set character association relationship;
determining a recognition result corresponding to each character according to the associated character of each character and the position of each character in the text to be recognized;
and generating a text recognition result aiming at the text to be recognized according to the recognition result corresponding to each character.
2. The method according to claim 1, wherein determining the recognition result corresponding to each character according to the associated character of each character and the position of each character in the text to be recognized comprises:
if a first type character exists in the characters, determining a recognition result corresponding to the first type character according to at least one of a single-body character, a front conjoined character, a double-conjoined character and a rear conjoined character associated with the first type character and the position of the first type character in the text to be recognized based on the position of the first type character in the text to be recognized, wherein the first type character is a character of which the associated character comprises the single-body character, the front conjoined character, the double-conjoined character and the rear conjoined character;
the character connection method comprises the steps of obtaining a character connection point, and obtaining a character connection point.
3. The method according to claim 2, wherein determining a recognition result corresponding to the first type character according to at least one of a solitary character, a preceding conjoined character, a double conjoined character and a succeeding conjoined character associated with the first type character based on the position of the first type character in the text to be recognized comprises:
if it is determined that characters exist at the front and rear adjacent positions of the first type character according to the position of the first type character in the text to be recognized, determining a recognition result corresponding to the first type character according to the double-connected character associated with the first type character and the rear connected character associated with the first type character;
if it is determined that characters exist at front adjacent positions of the first type characters according to the positions of the first type characters in the text to be recognized and no characters exist at rear adjacent positions, determining recognition results corresponding to the first type characters according to the independent characters associated with the first type characters and the front connected characters associated with the first type characters;
if it is determined that no character exists in the front adjacent position of the first type character and a character exists in the rear adjacent position according to the position of the first type character in the text to be recognized, taking the rear conjoined character associated with the first type character as a recognition result corresponding to the first type character;
and if it is determined that no character exists at the front and rear adjacent positions of the first type character according to the position of the first type character in the text to be recognized, taking the independent character associated with the first type character as a recognition result corresponding to the first type character.
4. The method according to claim 3, wherein determining the recognition result corresponding to the first type character according to the double-conjoined character associated with the first type character and the post-conjoined character associated with the first type character comprises:
acquiring a recognition result corresponding to the character at the front adjacent position of the first type character;
if the recognition result corresponding to the character at the front adjacent position of the first type character is the double-connected character or the rear connected character, taking the double-connected character associated with the first type character as the recognition result corresponding to the first type character;
and if the recognition result corresponding to the character at the front adjacent position of the first type character is the independent character or the front conjoined character, taking the rear conjoined character associated with the first type character as the recognition result corresponding to the first type character.
5. The method according to claim 3, wherein determining the recognition result corresponding to the first type character according to the first type character-associated unibody character and the first type character-associated concatemer character comprises:
acquiring a recognition result corresponding to the character at the front adjacent position of the first type character;
if the recognition result corresponding to the character at the front adjacent position of the first type character is the double-connected character or the rear connected character, taking the front connected character associated with the first type character as the recognition result corresponding to the first type character;
and if the recognition result corresponding to the character at the front adjacent position of the first type character is the independent character or the front conjoined character, taking the independent character associated with the first type character as the recognition result corresponding to the first type character.
6. The method according to claim 1, wherein determining the recognition result corresponding to each character according to the associated character of each character and the position of each character in the text to be recognized comprises:
if a second type character exists in the characters, determining a recognition result corresponding to the second type character according to at least one of a solitary character associated with the second type character and a preceding conjoined character associated with the second type character based on the position of the second type character in the text to be recognized, wherein the second type character is a character of which the associated character comprises the solitary character and the preceding conjoined character;
the independent character is a character which can not be connected with characters at front and back adjacent positions, and the front conjoined character is a character which is only connected with the characters at the front adjacent positions.
7. The method according to claim 6, wherein determining a recognition result corresponding to the second type of character according to at least one of a unibody character associated with the second type of character and a predecessor character associated with the second type of character based on a position of the second type of character in the text to be recognized comprises:
if it is determined that characters exist at front adjacent positions of the second type characters according to the positions of the second type characters in the text to be recognized, and characters do not exist at rear adjacent positions or exist at front adjacent positions and rear adjacent positions of the second type characters, determining a recognition result corresponding to the second type characters according to the independent characters associated with the second type characters and the front conjoined characters associated with the second type characters;
and if it is determined that no character exists at the front adjacent position of the second type character and a character exists at the rear adjacent position or no character exists at the front adjacent position and the rear adjacent position of the second type character according to the position of the second type character in the text to be recognized, taking the independent character associated with the second type character as a recognition result corresponding to the second type character.
8. The method according to claim 7, wherein determining the recognition result corresponding to the second type of character according to the unicode character associated with the second type of character and the preceding conjoined character associated with the second type of character comprises:
acquiring a recognition result corresponding to the character at the front adjacent position of the second type character;
if the recognition result corresponding to the character at the front adjacent position of the second type character is the double-conjoined character or the rear conjoined character, taking the front conjoined character associated with the second type character as the recognition result corresponding to the second type character;
and if the recognition result corresponding to the character at the front adjacent position of the second type character is the independent character or the front conjoined character, taking the independent character associated with the second type character as the recognition result corresponding to the second type character.
9. The method according to claim 1, wherein determining the recognition result corresponding to each character according to the associated character of each character and the position of each character in the text to be recognized comprises:
if a third type character exists in the characters, determining a recognition result corresponding to the third type character according to at least one of a preceding conjoined character and the third type character associated with the third type character based on the position of the third type character in the text to be recognized, wherein the third type character is a character which only contains the preceding conjoined character in the associated characters;
and the front conjoined character is a character which is only connected with the character at the front adjacent position.
10. The method according to claim 9, wherein determining a recognition result corresponding to the third type character according to at least one of a preceding concatenated character associated with the third type character and the third type character based on the position of the third type character in the text to be recognized comprises:
if it is determined that characters exist at front adjacent positions of the third type characters according to the positions of the third type characters in the text to be recognized, and characters do not exist at rear adjacent positions or characters exist at front adjacent positions and rear adjacent positions of the third type characters, determining a recognition result corresponding to the third type characters according to front conjoined characters related to the third type characters and the third type characters;
and if it is determined that no character exists in the front adjacent position of the third type character and a character exists in the rear adjacent position or no character exists in the front adjacent position of the third type character according to the position of the third type character in the text to be recognized, directly taking the third type character as the recognition result corresponding to the third type character.
11. The method according to claim 10, wherein determining the recognition result corresponding to the third type character according to the preceding conjoined character associated with the third type character and the third type character comprises:
acquiring a recognition result corresponding to the character at the front adjacent position of the third type character;
if the recognition result corresponding to the character at the front adjacent position of the third type character is the double-conjoined character or the rear conjoined character, taking the front conjoined character associated with the third type character as the recognition result corresponding to the third type character;
and if the recognition result corresponding to the character at the front adjacent position of the third type character is the independent character or the front conjoined character, directly taking the third type character as the recognition result corresponding to the third type character.
12. The method of claim 1, further comprising: if the associated character does not exist in the target character of the characters, directly taking the target character as a recognition result corresponding to the target character;
generating a text recognition result aiming at the text to be recognized according to the recognition result corresponding to each character, wherein the text recognition result comprises the following steps: adjusting the position of the target character in a plurality of continuous characters to be the first position of the plurality of continuous characters to obtain a new position sequence of the plurality of continuous characters;
according to the new position sequence, connecting the target characters and recognition results corresponding to other characters except the target characters in the continuous characters to generate words contained in the text to be recognized;
and generating a text recognition result aiming at the text to be recognized according to words contained in the text to be recognized.
13. A text recognition apparatus, characterized in that the apparatus comprises:
the processing unit is configured to perform character extraction and character position acquisition on a text to be recognized so as to obtain a plurality of characters contained in the text to be recognized and positions of the characters in the text to be recognized;
the acquisition unit is configured to acquire the associated characters of the characters based on the set character association relation;
the determining unit is configured to determine a recognition result corresponding to each character according to the associated character of each character and the position of each character in the text to be recognized;
and the generating unit is configured to generate a text recognition result aiming at the text to be recognized according to the recognition result corresponding to each character.
14. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out a text recognition method as claimed in any one of claims 1 to 12.
15. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the text recognition method of any one of claims 1 to 12.
CN202110129547.1A 2021-01-29 2021-01-29 Text recognition method and device, computer readable medium and electronic equipment Pending CN113569567A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110129547.1A CN113569567A (en) 2021-01-29 2021-01-29 Text recognition method and device, computer readable medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110129547.1A CN113569567A (en) 2021-01-29 2021-01-29 Text recognition method and device, computer readable medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN113569567A true CN113569567A (en) 2021-10-29

Family

ID=78161083

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110129547.1A Pending CN113569567A (en) 2021-01-29 2021-01-29 Text recognition method and device, computer readable medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN113569567A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114386410A (en) * 2022-01-11 2022-04-22 腾讯科技(深圳)有限公司 Training method and text processing method of pre-training model

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114386410A (en) * 2022-01-11 2022-04-22 腾讯科技(深圳)有限公司 Training method and text processing method of pre-training model
CN114386410B (en) * 2022-01-11 2023-07-11 腾讯科技(深圳)有限公司 Training method of pre-training model and text processing method

Similar Documents

Publication Publication Date Title
US11386271B2 (en) Mathematical processing method, apparatus and device for text problem, and storage medium
CN109063174B (en) Query answer generation method and device, computer storage medium and electronic equipment
CN110705301B (en) Entity relationship extraction method and device, storage medium and electronic equipment
CN111898696A (en) Method, device, medium and equipment for generating pseudo label and label prediction model
CN107861954B (en) Information output method and device based on artificial intelligence
CN112988979A (en) Entity identification method, entity identification device, computer readable medium and electronic equipment
CN108304376B (en) Text vector determination method and device, storage medium and electronic device
JP7384943B2 (en) Training method for character generation model, character generation method, device, equipment and medium
CN113761153A (en) Question and answer processing method and device based on picture, readable medium and electronic equipment
CN113761190A (en) Text recognition method and device, computer readable medium and electronic equipment
CN113761220A (en) Information acquisition method, device, equipment and storage medium
CN111597807B (en) Word segmentation data set generation method, device, equipment and storage medium thereof
CN113836866A (en) Text coding method and device, computer readable medium and electronic equipment
CN114398943B (en) Sample enhancement method and device thereof
CN115757731A (en) Dialogue question rewriting method, device, computer equipment and storage medium
CN114357195A (en) Knowledge graph-based question-answer pair generation method, device, equipment and medium
CN114780701A (en) Automatic question-answer matching method, device, computer equipment and storage medium
CN114528840A (en) Chinese entity identification method, terminal and storage medium fusing context information
CN113569567A (en) Text recognition method and device, computer readable medium and electronic equipment
CN111931503A (en) Information extraction method and device, equipment and computer readable storage medium
CN111507098B (en) Ambiguous word recognition method and device, electronic equipment and computer-readable storage medium
CN114490969A (en) Question and answer method and device based on table and electronic equipment
CN113705251A (en) Training method of machine translation model, language translation method and equipment
CN112446738A (en) Advertisement data processing method, device, medium and electronic equipment
CN113657092A (en) Method, apparatus, device and medium for identifying label

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40055185

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination