RU2500024C2 - Method for automated language detection and (or) text document coding - Google Patents
Method for automated language detection and (or) text document coding Download PDFInfo
- Publication number
- RU2500024C2 RU2500024C2 RU2011153489/08A RU2011153489A RU2500024C2 RU 2500024 C2 RU2500024 C2 RU 2500024C2 RU 2011153489/08 A RU2011153489/08 A RU 2011153489/08A RU 2011153489 A RU2011153489 A RU 2011153489A RU 2500024 C2 RU2500024 C2 RU 2500024C2
- Authority
- RU
- Russia
- Prior art keywords
- language
- document
- encoding
- byte sequences
- byte
- Prior art date
Links
Abstract
Description
Область техники, к которой относится изобретениеFIELD OF THE INVENTION
Настоящее изобретение относится к автоматизированному определению языка и (или) кодировки текстового документа и может быть использовано при разработке новых и совершенствовании существующих систем проверки текстовых документов.The present invention relates to the automated determination of the language and / or encoding of a text document and can be used to develop new and improve existing systems for checking text documents.
Уровень техникиState of the art
В процессе автоматического анализа текстовых документов, например, в случае отслеживания документов, проходящих по сети компании, на предмет наличия в них конфиденциальной информации, остро стоит задача определения языка, на котором записан проверяемый документ, либо кодировки бинарного представления этого документа.In the process of automatic analysis of text documents, for example, in the case of tracking documents passing through the company’s network for the presence of confidential information in them, the task of determining the language in which the document being checked is written, or the encoding of the binary representation of this document, is acute.
В настоящее время известны некоторые способы определению языка и (или) кодировки текстового документа.Currently, several methods are known for determining the language and / or encoding of a text document.
Так, в патенте РФ №2251737 (опубл. 10.05.2005) охарактеризован способ автоматического определения языка распознаваемого текста при многоязычном распознавании, в котором по распознанным отдельным символам текста формируют гипотезы о языковой принадлежности группы символов и проверяют эти гипотезы на основе перечня используемых лингвистических моделей, содержащего заранее составленные признаки символов всех предполагаемых языков. Нечто подобное используется и в заявке на патент США №2009/0024385 (опубл. 22.01.2009), где описан семантический грамматический анализатор, осуществляющий последовательный анализ предложений с компонентами на нескольких языках, по результатам чего строится граф, используемый в дальнейшем анализе. Эффективность этих способов недостаточно высока в силу использования отдельных символов или групп символов, поскольку в тексте могут встречаться цитаты на ином языке.So, in RF patent No. 2251737 (publ. 10.05.2005), a method is described for automatically determining the language of a recognizable text with multilingual recognition, in which hypotheses about the language of a group of characters are formed from recognized individual characters of the text and these hypotheses are tested based on the list of used linguistic models, containing pre-compiled features of characters of all alleged languages. Something similar is also used in application for US patent No. 2009/0024385 (published on January 22, 2009), which describes a semantic grammar analyzer that performs sequential analysis of sentences with components in several languages, based on which a graph is used for further analysis. The effectiveness of these methods is not high enough due to the use of individual characters or groups of characters, as the text may contain quotes in another language.
Наиболее близким можно считать патент США №8041566 (опубл. 18.10.2011), где раскрыты тематически специфичные модели для форматирования текста и распознавания речи. В этом способе сегментируют текст, и каждому сегменту назначают модель из набора тематически специфичных моделей, содержащих статистическую информацию о вероятности языковой модели, обработке текста и правилах форматирования, к примеру, интерпретацию команд для пунктуации, высвечивания частей текста и т.п., а также характеристический словарь для этого сегмента. Способ имеет ограниченное применение, поскольку он предназначен в первую очередь для форматирования текста.The closest can be considered US patent No. 8041566 (publ. 18.10.2011), which discloses thematically specific models for formatting text and speech recognition. In this method, text is segmented, and each segment is assigned a model from a set of thematically specific models containing statistical information about the probability of a language model, text processing and formatting rules, for example, interpretation of commands for punctuation, highlighting parts of text, etc., as well characteristic vocabulary for this segment. The method has limited application, since it is primarily intended for formatting text.
Раскрытие изобретенияDisclosure of invention
Цель настоящего изобретения состоит в обеспечении такого способа, который расширял бы арсенал технических средств и позволял автоматически определять язык и (или) кодировку текста по заранее набранной статистике в любых текстовых документах.The purpose of the present invention is to provide such a method that would expand the arsenal of technical means and allow you to automatically determine the language and (or) the encoding of the text according to pre-set statistics in any text documents.
Для решения этой задачи и достижения указанного технического результата в настоящем изобретении предложен способ автоматизированного определения языка и (или) кодировки текстового документа, заключающийся в том, что: выделяют байтовые последовательности, входящие в электронные версии эталонных документов, тексты которых записаны на соответствующем языке и (или) закодированы соответствующей кодировкой; подсчитывают статистику встречаемости выделенных байтовых последовательностей для эталонных документов, тексты которых записаны на одном языке и (или) закодированы в одной кодировке; строят на основе подсчитанной статистики профили каждого языка и (или) каждой кодировки в виде множества байтовых последовательностей с указанием веса каждой байтовой последовательности в данном языке и (или) в данной кодировке; строят поисковый автомат для извлечения искомых байтовых последовательностей из байтового потока проверяемого документа; сохраняют в памяти построенный поисковый автомат и профили языков и (или) кодировок, совместно именуемые онтологией данной коллекции языков и (или) кодировок; находят байтовые последовательности в электронной версии каждого проверяемого документа с помощью поискового автомата; подсчитывают в качестве профиля проверяемого документа статистику встречаемости найденных байтовых последовательностей на основе онтологии; сопоставляют подсчитанный профиль проверяемого документа с профилями языков и (или) кодировок для определения релевантности языка и (или) кодировки данному проверяемому документу.To solve this problem and achieve the indicated technical result, the present invention proposes a method for automatically determining the language and / or encoding of a text document, which consists in the following: select byte sequences included in electronic versions of reference documents, the texts of which are written in the corresponding language and ( or) encoded with the appropriate encoding; count the statistics of occurrence of selected byte sequences for reference documents whose texts are written in one language and (or) encoded in one encoding; build on the basis of the calculated statistics the profiles of each language and (or) each encoding in the form of a set of byte sequences indicating the weight of each byte sequence in a given language and (or) in this encoding; building a search engine to extract the desired byte sequences from the byte stream of the document being checked; save in memory the constructed search engine and profiles of languages and (or) encodings, collectively referred to as the ontology of this collection of languages and (or) encodings; find byte sequences in the electronic version of each document being checked using a search engine; counting the statistics of occurrence of found byte sequences based on the ontology as the profile of the document being checked; match the calculated profile of the checked document with the profiles of languages and (or) encodings to determine the relevance of the language and (or) the encoding of this checked document.
Особенность способа по настоящему изобретению состоит в том, что для каждого языка и (или) для каждой кодировки могут выбирать наиболее характерные байтовые последовательности.A feature of the method of the present invention is that for each language and / or for each encoding, the most characteristic byte sequences can be selected.
Еще одна особенность способа по настоящему изобретению состоит в том, что поисковый автомат могут строить на основе алгоритма Ахо-Корасик для точного сопоставления множеств.Another feature of the method of the present invention is that a search engine can be built on the basis of the Aho-Korasik algorithm for exact matching of sets.
Подробное описание изобретенияDETAILED DESCRIPTION OF THE INVENTION
Настоящее изобретение может быть реализовано в любой вычислительной системе, например, в персональном компьютере, на сервере и т.п. Для осуществления изобретения необходимо также наличие соответствующей базы данных, в которой хранятся электронные файлы текстовых документов.The present invention can be implemented in any computing system, for example, in a personal computer, on a server, etc. For the implementation of the invention, it is also necessary to have an appropriate database in which electronic files of text documents are stored.
Способ автоматизированного определения языка и (или) кодировки текстового документа предназначен для автоматического определения языка и (или) кодировки текстового документа.A method for automatically determining the language and / or encoding of a text document is intended to automatically determine the language and / or encoding of a text document.
Сначала на основе специально подобранных коллекций текстов на различных языках либо уже в процессе использования (путем дополнения первоначальной коллекции текстов) в электронных версиях эталонных документов, тексты которых записаны на соответствующем языке и (или) закодированы соответствующей кодировкой, выделяют байтовые последовательности и подсчитывают статистику встречаемости выделенных байтовых последовательностей для эталонных документов, тексты которых записаны на одном языке и (или) закодированы в одной кодировке. На основе подсчитанной статистики строят профили каждого языка и (или) каждой кодировки в виде множества байтовых последовательностей с указанием веса каждой байтовой последовательности в данном языке и (или) в данной кодировке.First, on the basis of specially selected collections of texts in various languages or already in the process of use (by supplementing the original collection of texts) in electronic versions of standard documents whose texts are written in the corresponding language and (or) encoded with the appropriate encoding, byte sequences are selected and statistics on the occurrence of selected byte sequences for reference documents whose texts are written in one language and (or) encoded in one encoding. Based on the calculated statistics, profiles of each language and (or) each encoding are constructed in the form of a set of byte sequences indicating the weight of each byte sequence in a given language and (or) in a given encoding.
Следует отметить, что при накоплении байтовых последовательностей для каждого языка и (или) для каждой кодировки операторы, работающие на автоматизированном рабочем месте, могут выбирать наиболее характерные байтовые последовательности. Эта операция осуществляется для так называемого (в машинном обучении) «снижения размерности». Для этого можно использовать различные алгоритмы, в частности алгоритм для подсчета взаимной встречаемости (mutual information - см., например, http://en.wikipedia.org/wiki/Mutual_information) байтовой последовательности в размеченных документах и в категориях, которыми размечены документы. В данном случае категории - это языки или кодировки. Например, пусть последовательность «абв» встречается в украинском и русском языках в 10 документах украинского языка и 15 документах русского. Всего в русском языке 50 документов, в украинском, соответственно, 30. Всего пусть имеется 8 языков, на которых представлены документы.It should be noted that when accumulating byte sequences for each language and (or) for each encoding, operators working at the workstation can select the most characteristic byte sequences. This operation is carried out for the so-called (in machine learning) "dimensional reduction". To do this, you can use various algorithms, in particular, an algorithm for calculating mutual occurrence (mutual information - see, for example, http://en.wikipedia.org/wiki/Mutual_information) of the byte sequence in the marked up documents and in the categories by which the documents are marked out. In this case, the categories are languages or encodings. For example, let the sequence “abv” be found in Ukrainian and Russian in 10 documents of the Ukrainian language and 15 documents of Russian. There are 50 documents in Russian, 30 in Ukrainian, respectively. Let there be 8 languages in all, in which documents are presented.
Исходя из этих цифр и подсчитывается взаимная встречаемость байтовой последовательности (в данном случае последовательности «абв») в этих документах.Based on these numbers, the mutual occurrence of the byte sequence (in this case, the sequence “abv”) in these documents is calculated.
Профиль каждого языка и (или) каждой кодировки обычно формируют в виде вектора выделенных байтовых последовательностей, характерных для данного языка и (или) данной кодировки, по одному вектору на язык.The profile of each language and (or) each encoding is usually formed in the form of a vector of selected byte sequences characteristic of a given language and (or) this encoding, one vector per language.
В принципе, для языков и кодировок используются разные коллекции документов («обучающие множества»), но действия, выполняемые и в том, и в другом случае, будут одни и те же. В качестве языков могут использоваться не только естественные языки, но и языки программирования. Кодировки могут быть любыми: к примеру, это может быть кодировка ASCII или любая иная, в том числе специально разработанная.In principle, different collections of documents (“training sets”) are used for languages and encodings, but the actions performed in both cases will be the same. As languages, not only natural languages can be used, but also programming languages. Encodings can be any: for example, it can be ASCII or any other, including specially designed.
Далее строят поисковый автомат для извлечения искомых байтовых последовательностей из байтового потока документа, подлежащего проверке. Этот поисковый автомат может быть построен на основе алгоритма Ахо-Корасик для точного сопоставления множеств (см., например, http://e-maxx.ru/algo/aho_corasick или http://aho-corasick.narod.ru). Построенный поисковый автомат и профили языков и (или) кодировок, совместно именуемые онтологией данной коллекции языков и (или) кодировок, сохраняют в памяти для возможности их дальнейшего использования при проверке очередных текстовых документов.Next, a search engine is built to extract the desired byte sequences from the byte stream of the document to be checked. This search engine can be built on the basis of the Aho-Korasik algorithm for exact matching of sets (see, for example, http://e-maxx.ru/algo/aho_corasick or http://aho-corasick.narod.ru). The constructed search engine and profiles of languages and (or) encodings, collectively referred to as the ontology of this collection of languages and (or) encodings, are stored in memory for possible further use when checking regular text documents.
Теперь, при поступлении входного байтового потока проверяемого документа находят с помощью поискового автомата байтовые последовательности в электронной версии каждого проверяемого документа и подсчитывают статистику встречаемости найденных байтовых последовательностей на основе сохраненной в памяти онтологии. Иными словами, используя построенный и запомненный поисковый автомат, автоматически выявляют в проверяемом документе байтовые последовательности, выделенные в эталонных документах, и подсчитывает статистику встречаемости. Эта статистика представляет собой профиль проверяемого документа. Затем сопоставляют этот профиль (подсчитанную статистику) проверяемого документа с запомненными профилями языков и (или) кодировок для определения релевантности того или иного языка и (или) той или иной кодировки данному проверяемому документу. В качестве языка и (или) кодировки, определенных в результате данных действий, выбирают, например, тот язык или ту кодировку, которые имеют наибольшую степень релевантности.Now, upon receipt of the input byte stream of the document being checked, byte sequences are found in the electronic version of each document being checked using the search engine and statistics on the occurrence of the found byte sequences based on the stored ontology are calculated. In other words, using the constructed and memorized search engine, the byte sequences highlighted in the reference documents are automatically detected in the document being checked and counts the statistics of occurrence. This statistic is the profile of the document being checked. Then, this profile (calculated statistics) of the checked document is compared with the stored profiles of languages and (or) encodings to determine the relevance of a particular language and (or) this or that encoding to this checked document. As the language and / or encoding determined as a result of these actions, choose, for example, the language or the encoding that have the highest degree of relevance.
Таким образом, способ по настоящему изобретению, расширяющий арсенал технических средств, позволяет автоматически определять язык и (или) кодировку текста по заранее набранной статистике в любых текстовых документах.Thus, the method of the present invention, expanding the arsenal of technical means, allows you to automatically determine the language and (or) the encoding of the text according to pre-collected statistics in any text documents.
Claims (3)
- выделяют байтовые последовательности, входящие в электронные версии эталонных документов, тексты которых записаны на соответствующем языке и (или) закодированы соответствующей кодировкой;
- подсчитывают статистику встречаемости выделенных байтовых последовательностей для эталонных документов, тексты которых записаны на одном языке и (или) закодированы в одной кодировке;
- строят на основе подсчитанной статистики профили каждого языка и (или) каждой кодировки в виде множества байтовых последовательностей с указанием веса каждой байтовой последовательности в данном языке и (или) в данной кодировке;
- строят поисковый автомат для извлечения искомых байтовых последовательностей из байтового потока проверяемого документа;
- сохраняют в памяти построенный поисковый автомат и профили языков и (или) кодировок, совместно именуемые онтологией данной коллекции языков и (или) кодировок;
- находят байтовые последовательности в электронной версии каждого проверяемого документа с помощью упомянутого поискового автомата;
- подсчитывают в качестве профиля проверяемого документа статистику встречаемости найденных байтовых последовательностей на основе упомянутой онтологии;
- сопоставляют подсчитанный профиль проверяемого документа с упомянутыми профилями языков и (или) кодировок для определения релевантности языка и (или) кодировки данному проверяемому документу.1. A method for automatically determining the language and (or) encoding of a text document, which consists in the fact that:
- select byte sequences included in electronic versions of standard documents, the texts of which are written in the corresponding language and (or) encoded with the corresponding encoding;
- calculate the statistics of occurrence of selected byte sequences for reference documents, the texts of which are written in one language and (or) encoded in one encoding;
- build on the basis of the calculated statistics the profiles of each language and (or) each encoding in the form of a set of byte sequences indicating the weight of each byte sequence in a given language and (or) in this encoding;
- build a search engine to extract the desired byte sequences from the byte stream of the document being checked;
- save in memory the constructed search engine and profiles of languages and (or) encodings, collectively referred to as the ontology of this collection of languages and (or) encodings;
- find byte sequences in the electronic version of each document being checked using the said search engine;
- count as the profile of the checked document the statistics of occurrence of found byte sequences based on the ontology;
- compare the calculated profile of the checked document with the mentioned profiles of languages and (or) encodings to determine the relevance of the language and (or) the encoding of this checked document.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
RU2011153489/08A RU2500024C2 (en) | 2011-12-27 | 2011-12-27 | Method for automated language detection and (or) text document coding |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
RU2011153489/08A RU2500024C2 (en) | 2011-12-27 | 2011-12-27 | Method for automated language detection and (or) text document coding |
Publications (2)
Publication Number | Publication Date |
---|---|
RU2011153489A RU2011153489A (en) | 2013-07-10 |
RU2500024C2 true RU2500024C2 (en) | 2013-11-27 |
Family
ID=48787265
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
RU2011153489/08A RU2500024C2 (en) | 2011-12-27 | 2011-12-27 | Method for automated language detection and (or) text document coding |
Country Status (1)
Country | Link |
---|---|
RU (1) | RU2500024C2 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
RU2607989C1 (en) * | 2015-07-08 | 2017-01-11 | Закрытое акционерное общество "МНИТИ" (сокращенно ЗАО "МНИТИ") | Method for automated identification of language or linguistic group of text |
RU2610245C2 (en) * | 2014-10-21 | 2017-02-08 | Сяоми Инк. | Method and device for web page encode identification |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
RU2210809C2 (en) * | 2000-11-21 | 2003-08-20 | Открытое акционерное общество "Московская телекоммуникационная корпорация" | Method for ordering data submitted in alphanumeric information blocks |
RU2251737C2 (en) * | 2002-10-18 | 2005-05-10 | Аби Софтвер Лтд. | Method for automatic recognition of language of recognized text in case of multilingual recognition |
EA011266B1 (en) * | 2004-06-04 | 2009-02-27 | Нетпиа.Ком, Инк. | Native language internet address system |
US7689531B1 (en) * | 2005-09-28 | 2010-03-30 | Trend Micro Incorporated | Automatic charset detection using support vector machines with charset grouping |
RU2009127102A (en) * | 2006-12-18 | 2011-01-27 | Нокиа Корпорейшн (Fi) | METHOD, DEVICE AND COMPUTER SOFTWARE PRODUCT FOR FLEXIBLE LANGUAGE IDENTIFICATION ON THE TEXT BASIS |
US8041566B2 (en) * | 2003-11-21 | 2011-10-18 | Nuance Communications Austria Gmbh | Topic specific models for text formatting and speech recognition |
-
2011
- 2011-12-27 RU RU2011153489/08A patent/RU2500024C2/en active IP Right Revival
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
RU2210809C2 (en) * | 2000-11-21 | 2003-08-20 | Открытое акционерное общество "Московская телекоммуникационная корпорация" | Method for ordering data submitted in alphanumeric information blocks |
RU2251737C2 (en) * | 2002-10-18 | 2005-05-10 | Аби Софтвер Лтд. | Method for automatic recognition of language of recognized text in case of multilingual recognition |
US8041566B2 (en) * | 2003-11-21 | 2011-10-18 | Nuance Communications Austria Gmbh | Topic specific models for text formatting and speech recognition |
EA011266B1 (en) * | 2004-06-04 | 2009-02-27 | Нетпиа.Ком, Инк. | Native language internet address system |
US7689531B1 (en) * | 2005-09-28 | 2010-03-30 | Trend Micro Incorporated | Automatic charset detection using support vector machines with charset grouping |
RU2009127102A (en) * | 2006-12-18 | 2011-01-27 | Нокиа Корпорейшн (Fi) | METHOD, DEVICE AND COMPUTER SOFTWARE PRODUCT FOR FLEXIBLE LANGUAGE IDENTIFICATION ON THE TEXT BASIS |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
RU2610245C2 (en) * | 2014-10-21 | 2017-02-08 | Сяоми Инк. | Method and device for web page encode identification |
RU2607989C1 (en) * | 2015-07-08 | 2017-01-11 | Закрытое акционерное общество "МНИТИ" (сокращенно ЗАО "МНИТИ") | Method for automated identification of language or linguistic group of text |
Also Published As
Publication number | Publication date |
---|---|
RU2011153489A (en) | 2013-07-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105426539B (en) | A kind of lucene Chinese word cutting method based on dictionary | |
EP3819785A1 (en) | Feature word determining method, apparatus, and server | |
CN108959258B (en) | Specific field integrated entity linking method based on representation learning | |
CN107102993B (en) | User appeal analysis method and device | |
CN111767716A (en) | Method and device for determining enterprise multilevel industry information and computer equipment | |
CN103778205A (en) | Commodity classifying method and system based on mutual information | |
WO2017091985A1 (en) | Method and device for recognizing stop word | |
CN110134777B (en) | Question duplication eliminating method and device, electronic equipment and computer readable storage medium | |
CN103605691A (en) | Device and method used for processing issued contents in social network | |
CN110472203B (en) | Article duplicate checking and detecting method, device, equipment and storage medium | |
CN110008474B (en) | Key phrase determining method, device, equipment and storage medium | |
CN110909531A (en) | Method, device, equipment and storage medium for discriminating information security | |
CN110781673B (en) | Document acceptance method and device, computer equipment and storage medium | |
Bhakuni et al. | Evolution and evaluation: Sarcasm analysis for twitter data using sentiment analysis | |
CN106815209B (en) | Uygur agricultural technical term identification method | |
CN112328469B (en) | Function level defect positioning method based on embedding technology | |
RU2500024C2 (en) | Method for automated language detection and (or) text document coding | |
CN113111645A (en) | Media text similarity detection method | |
CN110837730B (en) | Method and device for determining unknown entity vocabulary | |
Zhang et al. | Chinese novelty mining | |
US9336197B2 (en) | Language recognition based on vocabulary lists | |
Mahor et al. | Public Sentiment Assessment of Coronavirus-Specific Tweets using a Transformer-based BERT Classifier | |
CN115827867A (en) | Text type detection method and device | |
CN103605692A (en) | Device and method used for shielding advertisement contents in ask-and-answer community | |
Córdova Sáenz et al. | Assessing the use of attention weights to interpret BERT-based stance classification |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PD4A | Correction of name of patent owner | ||
MM4A | The patent is invalid due to non-payment of fees |
Effective date: 20181228 |
|
NF4A | Reinstatement of patent |
Effective date: 20191211 |