Uygur language identification method, device and storage medium

文档序号:661722 发布日期:2021-04-27 浏览:26次 中文

阅读说明:本技术 一种维吾尔文语种识别方法、装置及存储介质 (Uygur language identification method, device and storage medium ) 是由 庄灿波 赵建强 张辉极 杜新胜 黄剑 刘晓芳 陈志明 郑伟斌 于 2020-12-17 设计创作,主要内容包括:本发明公开了一种维吾尔文语种识别方法,通过构建基于维吾尔文的词汇数据库,并且基于维吾尔文语句的联合概率函数建立语言模型;根据待分析数据的词数选择词汇数据库或语言模型判断待分析数据是否为维吾尔文,其中通过语言模型计算出条件概率值以评估待分析数据的语句的合理性,并通过归一化处理的结果分析出待分析数据是否为维吾尔文。通过词汇数据库比对,对较短的内容进行判断提高准确度。本发明通过词汇数据库查询以及语言模型分析的技术提升对聊天内容中的维文识别。通过维文聊天数据和新闻数据能够准确的判断聊天中的维文信息,有助于维文翻译以及对聊天内容的分析阅读。(The invention discloses a Uygur language type identification method, which is characterized in that a language model is established by constructing a vocabulary database based on Uygur language and based on a joint probability function of Uygur language sentences; and selecting a vocabulary database or a language model according to the number of words of the data to be analyzed to judge whether the data to be analyzed is Uygur, wherein the conditional probability value is calculated through the language model to evaluate the reasonability of sentences of the data to be analyzed, and whether the data to be analyzed is Uygur is analyzed through the result of normalization processing. And the accuracy is improved by judging shorter contents through comparison of the vocabulary database. The invention improves the recognition of the Uyghur in the chat content by the vocabulary database query and the language model analysis technology. The Uygur information in the chat can be accurately judged through the Uygur chat data and the news data, and the Uygur translation and the analysis reading of chat contents are facilitated.)

1. A Uygur language species identification method is characterized by comprising the following steps:

a modeling step, namely constructing a vocabulary database based on Uygur language and establishing a language model based on a joint probability function of Uygur language sentences;

and a judging step, selecting the vocabulary database or the language model according to the number of words of the data to be analyzed to judge whether the data to be analyzed is Uygur, wherein the conditional probability value is calculated through the language model to evaluate the reasonability of the statement of the data to be analyzed, and whether the data to be analyzed is Uygur is analyzed through the result of normalization processing.

2. The Uygur language species identification method according to claim 1, further comprising:

and a preprocessing step, namely preprocessing the acquired corpus and the data to be analyzed, wherein the corpus comprises a training corpus.

3. The Uygur language species identification method according to claim 2, wherein the preprocessing step specifically comprises:

deleting the URL address, the email box and the emoticon;

deleting characters except non-Uyghur;

if Latin characters exist in the corpus and the data to be analyzed, converting the Latin characters in the corpus and the data to be analyzed into corresponding Arabic characters respectively.

4. The Uygur language species identification method of claim 2, wherein the modeling step specifically comprises:

storing all vocabularies containing Uygur in the preprocessed corpus to form a vocabulary database;

the language model is built based on an N-gram language model and Bayesian theorem, and the language model is trained through the training corpus, wherein the training corpus comprises Arabic, Persian, Turkey and Uygur which are written by Arabic.

5. The Uyghur language species recognition method as claimed in claim 4, wherein the language model specifically comprises:

for a sentence consisting of n words, s ═ w1w2…wnThe probability formula can be expressed as: p(s) ═ P (w)1)P(w2|w1)…P(wn|w1w2…wn-1) The probability of the ith word in the formula is determined by the first i-1 words which have been generated, the language model is built based on a 3-gram language model to evaluate the reasonableness of the sentence, and the formula is expressed as:

for the training corpus, Bayesian theorem is used, and the conditional probability value is expressed as:

wherein, C (w)iwj) Representing w in the corpusiwjThe number of times of statistics, | V | is the number of all unary characters, binary characters and ternary charactersAn amount;

and counting the occurrence times of the unary characters, the two-element characters and the three-element characters of the training corpus and storing the occurrences times in a model parameter database.

6. The Uygur language species recognition method of claim 1, wherein the judging step specifically comprises:

calculating the word number of the data to be analyzed;

if the number of words is less than a first threshold value, judging whether the data to be analyzed is Uygur language by consulting the vocabulary database;

if the number of words is more than a first threshold value, traversing each character in the data to be analyzed, calculating the conditional probability value of the data to be analyzed through the language model, carrying out normalization processing on the conditional probability value to obtain probability values corresponding to Arabic, Persian, Turkish and Uygur languages, obtaining a maximum value in the probability values, judging whether the language corresponding to the maximum value is Uygur language, and then judging whether the data to be analyzed is Uygur language according to whether the maximum value exceeds a second threshold value.

7. The Uyghur language identification method as claimed in claim 6, wherein the normalization process uses the following formula:

wherein i corresponds to the languages Arabic, Persian, Turkey and Uygur, respectively.

8. The Uyghur language identification method as claimed in claim 6, wherein C (w) is searched from the model parameter database when calculating the conditional probability value of the data to be analyzedi-2wi-1wi) And C (w)i-2wi-1) A value of (b), wherein wiIs the current character if wiAs first character, C (w)i-2wi-1wi) It becomes to calculate C (w)i) Value of (a), C (w)i-2wi-1) It becomes the sum of all the individual characters, if wiPreceding only one character, C (w)i-2wi-1wi) Then it becomes query C (w)i-1wi) Value of (a), C (w)i- 2wi-1) Becomes query C (w)i-1) The value of (c).

9. The Uygur language species recognition method of claim 3, wherein the judging step further comprises:

and judging that the data to be analyzed is Arabian, Latin Wigner, mixed content of Arabian and Latin Wigner or non-Wigner by combining the record of the process of converting the Latin characters in the data to be analyzed into corresponding Arabic characters.

10. An Uygur language species recognition device, comprising:

a modeling module configured to construct a Uygur language-based lexical database and to build a language model based on a joint probability function of Uygur sentences;

and the judging module is configured to select the vocabulary database or the language model according to the number of words of the data to be analyzed to judge whether the data to be analyzed is Uygur, wherein the conditional probability value is calculated through the language model to evaluate the reasonability of the statement of the data to be analyzed, and whether the data to be analyzed is Uygur is analyzed through the normalization processing result.

11. An electronic device, comprising:

one or more processors;

a storage device for storing one or more programs,

when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-9.

12. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-9.

Technical Field

The invention relates to the field of language identification, in particular to a Uyghur language identification method, a Uyghur language identification device and a storage medium.

Background

Machine translation refers to the process of converting one natural language (source language) to another natural language (target language) using a computer. With the rapid development of the globalization of economy and the internet, translation plays an increasingly important role in promoting political, economic and cultural communication. The translation software needs to judge the language type of the text (source language) in the process of translating the text, and usually, the language type can be set manually, and the language type of the text to be translated can be determined by character coding and database comparison methods.

At present, the difference between Chinese and Wei-Han is large, and the realization of the Wei-Han translation has important significance for culture exchange. In the process of dimension-Chinese translation, dimension language recognition needs to be carried out on a text to be translated, and since dimension language writing comprises Latin dimension writing written by Latin characters and ancient dimension writing written by Arabic, the dimension language recognition is difficult for people unfamiliar with dimension language or databases. Particularly, for the misidentification of a short spoken language text such as a chat content, the translation quality is likely to be poor. The invention aims to improve the recognition of two Uygur forms in the Uygur chat text translation process.

The Wei language comprises two writing forms of Guwei language and Latin Wei language, the Guwei language and the Arabic language are difficult to distinguish, the Latin Wei language and the Latin language are difficult to distinguish, and the condition of inaccurate judgment exists by using a coding method or a database method. Especially for the judgment of the mixed text with spoken language, short content and multiple languages, such as chatting text.

In view of this, it is very significant to establish a method and apparatus for identifying the species of Uygur language.

Disclosure of Invention

The problems that the difficulty of identifying the Uygur language in the chat content is high, the judgment is inaccurate and the like are solved. An object of the present application is to provide a method, an apparatus and a storage medium for identifying a kind of Uyghur language to solve the technical problems mentioned in the background section above.

In a first aspect, an embodiment of the present application provides a method for identifying a species of a uygur language, including the following steps:

a modeling step, namely constructing a vocabulary database based on Uygur language and establishing a language model based on a joint probability function of Uygur language sentences;

and a judging step, selecting a vocabulary database or a language model according to the number of words of the data to be analyzed to judge whether the data to be analyzed is Uyghur, wherein the conditional probability value is calculated through the language model to evaluate the reasonability of the statement of the data to be analyzed, and whether the data to be analyzed is Uyghur is analyzed through the result of normalization processing.

In some embodiments, further comprising:

and a preprocessing step, namely preprocessing the acquired corpus and the data to be analyzed, wherein the corpus comprises a training corpus.

The language model is trained by using a large amount of chatting data and written data, regular written Uigure and Uigure judgment in chatting are used, and the judgment accuracy is improved.

In some embodiments, the pre-processing step specifically comprises:

deleting the URL address, the email box and the emoticon;

deleting characters except non-Uyghur;

if Latin characters exist in the corpus and the data to be analyzed, the Latin characters in the corpus and the data to be analyzed are converted into corresponding Arabic characters respectively. Because the Latin Wei language and the ancient Wei language have corresponding relation, the obtained Latin Wei language material is converted into the ancient Wei language material, and the ancient Wei language material is enriched.

In some embodiments, the modeling step specifically comprises:

storing all vocabularies containing Uygur in the preprocessed corpus to form a vocabulary database;

the language model is established based on an N-gram language model and combined with Bayesian theorem, and the language model is trained through training corpora, wherein the training corpora comprise Arabic, Persian, Turkish and Uygur which are written by Arabic.

Establishing a vocabulary database for inquiring the dimension vocabulary and the language model, wherein the rationality of the sentences can be evaluated by establishing the language model, the N-gram language model is based on a statistical algorithm, and large probability can be given to meaningful sentences and small probability can be given to nonsensical sentences by combining Bayes theorem.

In some embodiments, the language model specifically includes:

for a sentence consisting of n words, s ═ w1w2…wnThe probability formula can be expressed as: p(s) ═ P (w)1)P(w2|w1)…P(wn|w1w2…wn-1) And the probability of the ith word in the formula is determined by the first i-1 words which are generated, and the language model is built based on a 3-gram language model to evaluate the reasonability formula of the statement and is expressed as follows:

for the training corpus, Bayesian theorem is used, and the conditional probability value is expressed as:

wherein, C (w)iwj) Representing w in corpusiwjCounting times, wherein | V | is the number of all unary characters, binary characters and ternary characters;

and counting the occurrence times of the unary characters, the two-element characters and the three-element characters of the training corpus and storing the statistics in a model parameter database.

In some embodiments, the determining step specifically includes:

calculating the word number of the data to be analyzed;

if the number of words is less than the first threshold value, judging whether the data to be analyzed is Uygur language by consulting the vocabulary database;

if the number of words is more than a first threshold value, traversing each character in the data to be analyzed, calculating a conditional probability value of the data to be analyzed through a language model, carrying out normalization processing on the conditional probability value to obtain probability values corresponding to Arabic, Persian, Turkish and Uygur languages, obtaining a maximum value in the probability values, judging whether the language corresponding to the maximum value is Uygur language or not, and then judging whether the data to be analyzed is Uygur language or not according to whether the maximum value exceeds a second threshold value or not.

The length of the chatting data is too short and is not suitable for being judged by a language model, and the database vocabulary query is more accurate. Longer lengths can be judged using language models.

In some embodiments, the normalization process uses the following formula:

wherein i corresponds to the languages Arabic, Persian, Turkey and Uygur, respectively.

In some embodiments, C (w) is queried from a model parameter database in calculating conditional probability values for data to be analyzedi-2wi-1wi) And C (w)i-2wi-1) A value of (b), wherein wiIs the current character if wiAs first character, C (w)i-2wi-1wi) It becomes to calculate C (w)i) Value of (a), C (w)i-2wi-1) It becomes the sum of all the individual characters, if wiPreceding only one character, C (w)i-2wi-1wi) Then it becomes query C (w)i-1wi) Value of (a), C (w)i-2wi-1) Becomes query C (w)i-1) The value of (c). The calculation of the language model is facilitated by the number of times of occurrence of the query characters in the model parameter database.

In some embodiments, the determining step further comprises:

and judging that the data to be analyzed is Arabian, Latin Wigner, the mixed content of Arabian and Latin Wigner or non-Wigner by combining the record of the process of converting the Latin characters in the data to be analyzed into the corresponding Arabic characters. The text composition of the data to be analyzed can be further analyzed.

In a second aspect, an embodiment of the present application further provides an apparatus for identifying an uygur language species, including:

a modeling module configured to construct a Uygur language-based lexical database and to build a language model based on a joint probability function of Uygur sentences;

and the judging module is configured to select a vocabulary database or a language model according to the number of words of the data to be analyzed to judge whether the data to be analyzed is Uygur, wherein the condition probability value is calculated through the language model to evaluate the reasonability of the statement of the data to be analyzed, and whether the data to be analyzed is Uygur is analyzed through the result of normalization processing.

In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; storage means for storing one or more programs which, when executed by one or more processors, cause the one or more processors to carry out a method as described in any one of the implementations of the first aspect.

In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the method as described in any implementation manner of the first aspect.

The embodiment of the application provides a Uygur language identification method, which comprises the steps of constructing a vocabulary database based on Uygur language and establishing a language model based on a joint probability function of Uygur language sentences; and selecting a vocabulary database or a language model according to the number of words of the data to be analyzed to judge whether the data to be analyzed is Uyghur, wherein a conditional probability value is calculated through the language model to evaluate the reasonability of sentences of the data to be analyzed, and whether the data to be analyzed is Uyghur is analyzed through a normalization processing result. Based on the combination of vocabulary inquiry and language model judgment, whether Uyghur exists in the chat content is judged so as to improve the accuracy of Uyghur judgment. The language model is trained by using a large amount of chatting data and written data, and the regular written dimension and the dimension in the chatting are used for judgment, so that the judgment accuracy is improved. And the accuracy is improved by judging the shorter content through database comparison. The invention improves the recognition of the wives in the chat content through the technologies of vocabulary database query and language model analysis. The Uygur information in the chat can be accurately judged through the Uygur chat data and the news data, and the Uygur translation and the analysis reading of chat contents are facilitated.

Drawings

In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.

FIG. 1 is an exemplary device architecture diagram in which one embodiment of the present application may be applied;

FIG. 2 is a flow chart illustrating a Uyghur language identification method according to an embodiment of the present invention;

FIG. 3 is a flowchart illustrating step S0 of the Uyghur language identification method according to the embodiment of the present invention;

FIG. 4 is a schematic structural diagram of step S1 of the Uyghur language identification method according to the embodiment of the present invention;

FIG. 5 is a schematic structural diagram of step S2 of the Uyghur language identification method according to the embodiment of the present invention;

FIG. 6 is a schematic diagram of an Uyghur language identification device according to an embodiment of the invention;

fig. 7 is a schematic structural diagram of a computer device suitable for implementing an electronic apparatus according to an embodiment of the present application.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

Fig. 1 illustrates an exemplary device architecture 100 to which the method for identifying the species of uyghur or the device for identifying the species of uyghur according to the embodiments of the present application may be applied.

As shown in fig. 1, the apparatus architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.

The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. Various applications, such as data processing type applications, file processing type applications, etc., may be installed on the terminal apparatuses 101, 102, 103.

The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices including, but not limited to, smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as a plurality of software or software modules (e.g., software or software modules used to provide distributed services) or as a single software or software module. And is not particularly limited herein.

The server 105 may be a server that provides various services, such as a background data processing server that processes files or data uploaded by the terminal devices 101, 102, 103. The background data processing server can process the acquired file or data to generate a processing result.

It should be noted that the method for identifying the uygur language provided in the embodiment of the present application may be executed by the server 105 or the terminal devices 101, 102, and 103, and accordingly, the device for identifying the uygur language may be disposed in the server 105 or the terminal devices 101, 102, and 103.

It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. In the case where the processed data does not need to be acquired from a remote location, the above device architecture may not include a network, but only a server or a terminal device.

Fig. 2 shows that the embodiment of the present application discloses a method for identifying species of Uygur language, comprising the following steps:

s1, constructing a vocabulary database based on Uygur language, and establishing a language model based on a joint probability function of Uygur language sentences.

In a specific embodiment, before step S1, the method further includes:

s0, preprocessing the obtained linguistic data and the data to be analyzed, wherein the linguistic data comprises training linguistic data.

The augmented corpus is used to train the language model. The linguistic data written in Arabic characters, including Arabic, Persian, Turkey and Uygur, are obtained from the web. Sources of corpora include news websites, book materials, wikipedia, and chat content. The language model is trained by using a large amount of chatting data and written data, regular written Uigure and Uigure judgment in chatting are used, and the judgment accuracy is improved.

In a specific embodiment, as shown in fig. 3, step S0 specifically includes:

s01, deleting the URL address, the email box and the emoticon;

s02, deleting non-Uyghur characters;

and S03, if Latin characters exist in the corpus and the data to be analyzed, converting the Latin characters in the corpus and the data to be analyzed into corresponding Arabic characters respectively.

Because the Latin Wei language and the ancient Wei language have corresponding relation, the obtained Latin Wei language material is converted into the ancient Wei language material, and the ancient Wei language material can be enriched. At the moment, Latin Wei language is converted into ancient Wei language, and then the difference between Latin Wei language and ancient Wei language does not exist. Because the correspondence exists between the two, the difference is only written, the calculation can be saved, and the two language models do not need to be maintained.

In a specific embodiment, as shown in fig. 4, step S1 specifically includes:

s11, storing all vocabularies containing Uygur in the preprocessed corpus to form a vocabulary database;

s12, establishing a language model based on the N-gram language model and combining the Bayes theorem, and training the language model through a training corpus, wherein the training corpus comprises Arabic, Bose, Turkey and Uygur which are written by Arabic.

The method comprises the steps of establishing a vocabulary database for inquiring a dimension vocabulary, establishing a language model for evaluating the reasonability of sentences, and aiming at modeling a joint probability function of the sentences, wherein the language model aims to endow a large probability to meaningful sentences and endow a small probability to nonsense sentences.

In a specific embodiment, the language model specifically includes:

for a sentence composed of n wordsS ═ w1w2…wnThe probability formula can be expressed as: p(s) ═ P (w)1)P(w2|w1)…P(wn|w1w2…wn-1) And the probability of the ith word in the formula is determined by the first i-1 words which are generated, the language model is built based on a 3-gram language model to evaluate the reasonability of the statement, and the formula is expressed as follows:

for the training corpus, Bayesian theorem is used, and the conditional probability value is expressed as:

wherein, C (w)iwj) Representing w in corpusiwjCounting times, wherein | V | is the number of all unary characters, binary characters and ternary characters;

and counting the occurrence times of the unary characters, the two-element characters and the three-element characters of the training corpus and storing the statistics in a model parameter database.

The value calculated by the language model is used to measure the reasonableness of the sentence. The N-gram language model is a statistical-based algorithm. The above formula is a language model of the 3-gram, calculated as P (w) by frequency counting words composed of three words of the collected data seti|wi-2wi-1). The new sentence to be judged can be calculated by the formula to obtain the reasonable degree of the sentence. If a certain w in the sentencei-2wi-1wiIf the phrase does not appear in the dataset or appears very infrequently, then P (w)i|wi-2wi-1) The value of (c) will also be small.

S2, selecting a vocabulary database or a language model according to the number of words of the data to be analyzed to judge whether the data to be analyzed is Uygur, wherein, the conditional probability value is calculated through the language model to evaluate the reasonability of the statement of the data to be analyzed, and whether the data to be analyzed is Uygur is analyzed through the normalization processing result.

In a specific embodiment, after the data to be analyzed is preprocessed, step S2 is performed, as shown in fig. 5, step S2 specifically includes:

s21, calculating the word number of the data to be analyzed;

s22, if the number of words is less than the first threshold, judging whether the data to be analyzed is Uygur by consulting the vocabulary database;

s23, if the number of words is more than the first threshold, traversing each character in the data to be analyzed, calculating the conditional probability value of the data to be analyzed through the language model, carrying out normalization processing on the conditional probability value to obtain the probability values corresponding to Arabic, Persian, Turkish and Uygur languages, obtaining the maximum value in the probability values, judging whether the language corresponding to the maximum value is Uygur, and then judging whether the data to be analyzed is Uygur according to whether the maximum value exceeds the second threshold.

If the number of words of the data to be analyzed is too small, for example, less than 3 words, it is determined whether the data is Uygur by referring to the vocabulary database. If more than half of the searched vocabulary is Uygur, the vocabulary is judged to be Uygur. And judging the length of the data to be analyzed by using a language model when the length is more than 3. The chat data is too short and not suitable for being judged by a language model, and the vocabulary query by using the database is more accurate. The short chat data is not suitable for being judged by a language model, and the query is more accurate by using database vocabularies. And when the length is longer, the judgment is more accurate by using the language model.

In a specific embodiment, the normalization process uses the following formula:

wherein i corresponds to the languages Arabic, Persian, Turkey and Uygur, respectively.

In a particular embodiment, the analysis is performed during the calculationQuerying C (w) from the model parameter database for conditional probability values of datai-2wi-1wi) And C (w)i-2wi-1) A value of (b), wherein wiIs the current character if wiAs first character, C (w)i-2wi-1wi) It becomes to calculate C (w)i) Value of (a), C (w)i-2wi-1) It becomes the sum of all the individual characters, if wiPreceding only one character, C (w)i-2wi-1wi) Then it becomes query C (w)i-1wi) Value of (a), C (w)i-2wi-1) Becomes query C (w)i-1) The value of (c). The calculation of the language model is facilitated by the number of times of occurrence of the query characters in the model parameter database.

In a specific embodiment, step S2 further includes:

and judging that the data to be analyzed is Arabian, Latin Wigner, the mixed content of Arabian and Latin Wigner or non-Wigner by combining the record of the process of converting the Latin characters in the data to be analyzed into the corresponding Arabic characters. Therefore, the text composition of the data to be analyzed can be further analyzed. When the latin characters are converted to arabic characters, it is recorded whether or not the conversion is performed, and what parts of the sentence are converted.

With further reference to fig. 6, as an implementation of the method shown in the above figures, the present application provides an embodiment of an uygur language identification apparatus, which corresponds to the embodiment of the method shown in fig. 2, and which can be applied in various electronic devices.

An embodiment of the present application provides an apparatus for identifying a kind of uygur language, as shown in fig. 6, including:

a modeling module 1 configured to construct a vocabulary database based on Uygur, and to build a language model based on a joint probability function of Uygur sentences;

and the judging module 2 is configured to select a vocabulary database or a language model according to the number of words of the data to be analyzed to judge whether the data to be analyzed is Uygur, wherein the conditional probability value is calculated through the language model to evaluate the reasonability of the statement of the data to be analyzed, and whether the data to be analyzed is Uygur is analyzed through the normalization processing result.

In a specific embodiment, the method further comprises:

and the preprocessing module 0 is used for preprocessing the acquired corpus and the data to be analyzed, wherein the corpus comprises training corpora.

The language model is trained by using a large amount of chatting data and written data, regular written Uigure and Uigure judgment in chatting are used, and the judgment accuracy is improved.

In a specific embodiment, the preprocessing module 0 specifically includes:

deleting the URL address, the email box and the emoticon;

deleting characters except non-Uyghur;

if Latin characters exist in the corpus and the data to be analyzed, the Latin characters in the corpus and the data to be analyzed are converted into corresponding Arabic characters respectively. Because the Latin Wei language and the ancient Wei language have corresponding relation, the obtained Latin Wei language material is converted into the ancient Wei language material, and the ancient Wei language material is enriched.

The modeling module 1 specifically includes:

storing all vocabularies containing Uygur in the preprocessed corpus to form a vocabulary database;

the language model is established based on an N-gram language model and combined with Bayesian theorem, and the language model is trained through training corpora, wherein the training corpora comprise Arabic, Persian, Turkish and Uygur which are written by Arabic.

The method comprises the steps of establishing a vocabulary database for inquiring a dimension vocabulary, establishing a language model for evaluating the reasonability of sentences, and aiming at modeling a joint probability function of the sentences, wherein the language model aims to endow a large probability to meaningful sentences and endow a small probability to nonsense sentences.

In a specific embodiment, the language model specifically includes:

for a sentence consisting of n words s ═ sw1w2…wnThe probability formula can be expressed as: p(s) ═ P (w)1)P(w2|w1)…P(wn|w1w2…wn-1) And the probability of the ith word in the formula is determined by the first i-1 words which are generated, the language model is built based on a 3-gram language model to evaluate the reasonability of the statement, and the formula is expressed as follows:

for the training corpus, Bayesian theorem is used, and the conditional probability value is expressed as:

wherein, C (w)iwj) Representing w in corpusiwjCounting times, wherein | V | is the number of all unary characters, binary characters and ternary characters;

and counting the occurrence times of the unary characters, the two-element characters and the three-element characters of the training corpus and storing the statistics in a model parameter database.

In a specific embodiment, the determining module 2 specifically includes:

s21, calculating the word number of the data to be analyzed;

s22, if the number of words is less than the first threshold, judging whether the data to be analyzed is Uygur by consulting the vocabulary database;

s23, if the number of words is more than the first threshold, traversing each character in the data to be analyzed, calculating the conditional probability value of the data to be analyzed through the language model, carrying out normalization processing on the conditional probability value to obtain the probability values corresponding to Arabic, Persian, Turkish and Uygur languages, obtaining the maximum value in the probability values, judging whether the language corresponding to the maximum value is Uygur, and then judging whether the data to be analyzed is Uygur according to whether the maximum value exceeds the second threshold.

In a specific embodiment, the determining module 2 further includes:

and judging that the data to be analyzed is Arabian, Latin Wigner, the mixed content of Arabian and Latin Wigner or non-Wigner by combining the record of the process of converting the Latin characters in the data to be analyzed into the corresponding Arabic characters. The text composition of the data to be analyzed can be further analyzed.

The embodiment of the application provides a Uygur language identification method, which comprises the steps of constructing a vocabulary database based on Uygur language and establishing a language model based on a joint probability function of Uygur language sentences; and selecting a vocabulary database or a language model according to the number of words of the data to be analyzed to judge whether the data to be analyzed is Uyghur, wherein a conditional probability value is calculated through the language model to evaluate the reasonability of sentences of the data to be analyzed, and whether the data to be analyzed is Uyghur is analyzed through a normalization processing result. Based on the combination of vocabulary inquiry and language model judgment, whether Uyghur exists in the chat content is judged so as to improve the accuracy of Uyghur judgment. The language model is trained by using a large amount of chatting data and written data, and the regular written dimension and the dimension in the chatting are used for judgment, so that the judgment accuracy is improved. And the accuracy is improved by judging the shorter content through database comparison. The invention improves the recognition of the wives in the chat content through the technologies of vocabulary database query and language model analysis. The Uygur information in the chat can be accurately judged through the Uygur chat data and the news data, and the Uygur translation and the analysis reading of chat contents are facilitated.

Referring now to fig. 7, a schematic diagram of a computer device 700 suitable for use in implementing an electronic device (e.g., the server or terminal device shown in fig. 1) according to an embodiment of the present application is shown. The electronic device shown in fig. 7 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. 7, the computer apparatus 700 includes a Central Processing Unit (CPU)701 and a Graphics Processing Unit (GPU) 702, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)703 or a program loaded from a storage section 709 into a Random Access Memory (RAM) 704. In the RAM 704, various programs and data necessary for the operation of the apparatus 700 are also stored. The CPU 701, GPU702, ROM 703, and RAM 704 are connected to each other via a bus 705. An input/output (I/O) interface 706 is also connected to bus 705.

The following components are connected to the I/O interface 706: an input section 707 including a keyboard, a mouse, and the like; an output section 708 including a display such as a Liquid Crystal Display (LCD) and a speaker; a storage section 709 including a hard disk and the like; and a communication section 710 including a network interface card such as a LAN card, a modem, or the like. The communication section 710 performs communication processing via a network such as the internet. The driver 711 may also be connected to the I/O interface 706 as needed. A removable medium 712 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 711 as necessary, so that a computer program read out therefrom is mounted into the storage section 709 as necessary.

In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via the communication section 710 and/or installed from the removable medium 712. The computer program performs the above-described functions defined in the method of the present application when executed by a Central Processing Unit (CPU)701 and a Graphics Processing Unit (GPU) 702.

It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable medium or any combination of the two. The computer readable medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor device, apparatus, or any combination of the foregoing. More specific examples of the computer readable 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 or 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 medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution apparatus, device, or apparatus. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code 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 medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution apparatus, device, or apparatus. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.

Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).

The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, 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 and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based devices that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

The modules described in the embodiments of the present application may be implemented by software or hardware. The modules described may also be provided in a processor.

As another aspect, the present application also provides a computer-readable medium that 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 the electronic device, cause the electronic device to: constructing a vocabulary database based on Uygur language, and establishing a language model based on a joint probability function of Uygur language sentences; and selecting a vocabulary database or a language model according to the number of words of the data to be analyzed to judge whether the data to be analyzed is Uygur, wherein the condition probability value is calculated through the language model to evaluate the reasonability of the statement of the data to be analyzed, and whether the data to be analyzed is Uygur is analyzed through the result of normalization processing.

It is to be understood that the scope of the present invention in the present application is not limited to the embodiments in which the above-described features are combined in specific combinations, and the present invention also covers other embodiments in which the above-described features or their equivalents are combined in arbitrary combinations without departing from the scope of the present invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种分词方法、系统、分词器生成方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!