元々、書かれたタタール語のコーパス用に作られた高速コーパス検索エンジン。
ここで試すことができます。
ソースコードはhttps://github.com/mansayk/fastmorphで入手できます。
Query:
Word 1: китап
Number of occurences: 32209
Query processing time: 0,4 sec.
Query:
Word 1 (case sensitive, distance to the next word up to 3 words): Китап
Word 2 (if in brackets, then it is lemma): (бир)
Number of occurences: 15
Query processing time: 0,4 sec.
Quite heavy query:
Word 1 (word begins with "б" letter, distance range to the next word is from 1 to 10): б*
Word 2 (pronoun, word ends with "ң", distance range to the next word is from 1 to 10): <prn>*ң
Word 3 (lemma "кил", word ends with "р"): (кил)*р
Number of occurences: 135210
Query processing time: 0,8 sec.
Very heavy query:
Word 1 (word ends with "ы", distance range to the next word is from 1 to 100): *ы
Word 2 (word ends with "а", distance range to the next word is from 1 to 100): *а
Word 3 (word ends with "м", distance range to the next word is from 1 to 100): *м
Word 4 (word ends with "с", distance range to the next word is from 1 to 100): *с
Word 5 (word ends with "ь", distance range to the next word is from 1 to 100): *ь
Word 6 (word ends with "е"): *е
Number of occurences: 135210
Query processing time: 1,4 sec.
ここで試すことができます。コーパスのマニュアルにはさまざまな検索例があります。プロジェクトでFastMorphを使用することについて質問がある場合は、[email protected]までお問い合わせください。
また、この検索エンジンがどこで使用されているかをお知らせください。気にしない場合は、これらのプロジェクトへのリンクをここに公開します。
このソフトウェアは、GNU General Public License v3.0の下で配布されています。
検索クエリ:
Schematical view: {<adj>}(0) 1-5 {ке*<n>}(1) 1-1 {(кил)}(0) 1-1 {}(0) 1-1 {}(0) 1-1 {}(0)
Detailed:
Word 1 (distance range to the next word is from 1 to 5, adjective): <adj>
Word 2 (case sensitive, begins with "ке", noun): ке*<n>
Word 3: (lemma "кил"):(кил)
Word 4:
Word 5:
Word 6:
{
"word": [
"",
"",
"",
"",
"",
""
],
"lemma": [
"",
"",
"кил",
"",
"",
""
],
"tags": [
"<adj>",
"<n>",
"",
"",
"",
""
],
"wildmatch": [
"",
"ке*",
"",
"",
"",
""
],
"case": [
0,
1,
0,
0,
0,
0
],
"dist_from": [
1,
1,
1,
1,
1
],
"dist_to": [
5,
1,
1,
1,
1
],
"return": 100,
"last_pos": "0"
}
「返品」 - 返却するための最大の文章。
「last_pos」 - "0"最初のクエリの場合、またはこの文字列を返して次の文のリストを取得します。
警告! FastMorphに渡す前に、入力データを正規化して検証する必要があります。
{
"example": [
{
"id": 15853,
"source": ""2013 Универсиадасы блогы" (web-сайт)",
"source_type": "kazan2013.ru",
"sentence": "Универсиада кебек зур проектның бер өлеше булу өчен, Казанга Россиянең төрле
төбәкләреннән һәм Дөньяның
<span id='found_word_0' class='found_word' title='(төрле) <adj>'>төрле</span>
илләреннән бик күп
<span id='found_word_1' class='found_word' title='(кеше) <n>,<nom>,<sg>'>кеше</span>
<span id='found_word_2' class='found_word' title='(кил) <ifi>,<iv>,<p3>,<sg>,<v>'>килде</span>."
},
{
"id": -1
}
],
"last_pos": "892447x39311905x75980782x114356633",
"found_all": 1359
}
ご覧のとおり、検索クエリに一致する各単語は、次のHTMLタグで返されます。
<span id='found_word_0' class='found_word' title='(LEMMA) <TAG1><TAG2>'>FOUND_WORD</span>
したがって、たとえば、CSSを使用してそれらを強調することができます。
ここで作成するテーブルの例を見つけることができます。
mysql> select * from morph6_main_apertium limit 10;
| id | ユナイテッド | 文 | ソース |
|---|---|---|---|
| 0 | 1594501 | 1 | 1 |
| 1 | 761564 | 1 | 1 |
| 2 | 787834 | 1 | 1 |
| 3 | 1505641 | 1 | 1 |
| 4 | 420024 | 1 | 1 |
| 5 | 764201 | 1 | 1 |
| 6 | 1003674 | 1 | 1 |
| 7 | 1003851 | 1 | 1 |
| 8 | 764201 | 1 | 1 |
| 9 | 1057551 | 1 | 1 |
mysql> select * from morph6_united_apertium where id> = 100 limit 10;
| id | freq | word_case | 言葉 | 補題 | タグ |
|---|---|---|---|---|---|
| 100 | 1 | 1000084 | 599888 | 429156 | 2 |
| 101 | 60 | 1000085 | 599890 | 429158 | 2 |
| 102 | 5 | 1000086 | 599891 | 429159 | 2 |
| 103 | 2 | 1000087 | 599892 | 429160 | 2 |
| 104 | 1 | 1000088 | 599893 | 429161 | 2 |
| 105 | 10 | 1000089 | 599894 | 429162 | 2 |
| 106 | 1 | 100008 | 164606 | 119768 | 2 |
| 107 | 1 | 1000090 | 599895 | 429163 | 2 |
| 108 | 5 | 1000091 | 599899 | 429167 | 2 |
| 109 | 1 | 1000092 | 599901 | 429169 | 2 |
mysql> select * from morph6_words_case_apertiumここで、id> 200000リミット10;
| id | freq | word_case |
|---|---|---|
| 200001 | 4 | □а例するげ |
| 200002 | 1 | □а例нc |
| 200003 | 3 | □а例 |
| 200004 | 290 | □а例ң |
| 200005 | 14 | □арәсен防おり |
| 200006 | 1 | □а例ә |
| 200007 | 79 | □а例ә |
| 200008 | 1 | □а例ң |
| 200009 | 1 | □а例ә |
| 200010 | 1 | □а例アанә |
mysql> select * from morph6_words_apertiumここで、id> 100000リミット10;
| id | freq | 言葉 |
|---|---|---|
| 100001 | 975 | ™&qクション |
| 100002 | 7 | ™™äootfor |
| 100003 | 74 | ™™qu |
| 100004 | 1 | ™&qu? |
| 100005 | 1 | ™™qu |
| 100006 | 8 | ™&qu±現題 |
| 100007 | 1 | ™™qu |
| 100008 | 1 | ™™qu? |
| 100009 | 1408 | ™&qクション |
| 100010 | 3 | ™™äootfor |
mysql> select * from morph6_lemmas_apertiumここで、id> 300000リミット10;
| id | freq | 補題 |
|---|---|---|
| 300001 | 1 | □摩擦ч |
| 300002 | 130 | □芽ч |
| 300003 | 8 | □芽ч |
| 300004 | 2 | _S低ve |
| 300005 | 3 | □摩擦 |
| 300006 | 9 | □芽ч |
| 300007 | 2 | □芽ч |
| 300008 | 2 | □芽o.エクトル |
| 300009 | 1 | □芽ч |
| 300010 | 12 | □芽o.膝をgs |
mysql> select * from morph6_tags_apertiumここで、id> 11100制限10;
| id | freq | 組み合わせ |
|---|---|---|
| 11101 | 4 | <ant>、<dat>、<f>、<frm>、<np>、<px2sg> |
| 11102 | 17141 | <ant>、<dat>、<f>、<np> |
| 11103 | 387 | <ant>、<dat>、<f>、<np>、<pl> |
| 11104 | 1 | <ant>、<dat>、<f>、<np>、<pl>、<px1pl> |
| 11105 | 1 | <ant>、<dat>、<f>、<np>、<pl>、<px1sg> |
| 11106 | 12 | <ant>、<dat>、<f>、<np>、<pl>、<px3sp> |
| 11107 | 1 | <ant>、<dat>、<f>、<np>、<pl>、<px> |
| 11108 | 40 | <ant>、<dat>、<f>、<np>、<px1pl> |
| 11109 | 101 | <ant>、<dat>、<f>、<np>、<px1sg> |
| 11110 | 41 | <ant>、<dat>、<f>、<np>、<px2sg> |
mysql> select * col1> 300リミット3のソースから。
| col1 | col2 | col3 |
|---|---|---|
| 301 | "miras.belem.ru"(web-сthrueй親) | MIRAS.BELEM.RU |
| 302 | éorcyforiefheするに | 本 |
| 303 | °なって、ха上ƒ控示e e dәә頭 | Tatarstan.ru |
Apertiumのタガーを使用してコーパスを形態的に注釈する場合、Pythonスクリプトを使用して、Apertiumの出力からテーブルを生成できます。
このコンバーターを使用するには:
cat bigfile.txt | apertium -n -d . tat-tagger | cg-proc dev/mansur.bin > bigfile_tagged.txt
Mansur.binは、いくつかの追加のルールを備えた単なるファイルです。ここで見つけることができます。
その結果、注釈付き文を含むファイルを取得する必要があります。
^Мин/Мин<prn><pers><p1><sg><nom>$ ^үземне/үз<prn><ref><px1sg><acc>$ ^белә/бел<v><tv><prc_impf>$ ^башлаганнан/башла<vaux><ger_past><abl>$ ^бирле/бирле<post>$ ^түбән/түбән<adj>$ ^очка/оч<n><sg><dat>$ – ^ерак/ерак<adj>$ ^бабакайларга/бабакай<n><pl><dat>$ ^төшәргә/төш<v><iv><inf>$ ^ярата/ярат<v><tv><pres><p3><sg>$ ^идем/и<cop><ifi><p1><sg>$^./.<sent>$
| 文ID | ソースID |
|---|---|
| 1 | 1 |
| 2 | 1 |
| 3 | 1 |
| 4 | 1 |
| 5 | 1 |
| 6 | 1 |
| 7 | 1 |
| 8 | 1 |
| 9 | 1 |
| 10 | 1 |
スクリプトを使用して同じディレクトリに配置します。
3)このようにPythonスクリプトを実行します。
./tat-tagger_to_ntables_v6.24.py tatcorpus2.sentences.apertium.tagged.txt
コーパスのサイズに応じてかなりの時間がかかります。
4)すべてがうまくいった場合は、MySQLデータベースにインポートする必要がある新しいファイルのリストを取得する必要があります。
tatcorpus2.sentences.apertium.tagged.txt.lemmas.output.txt
tatcorpus2.sentences.apertium.tagged.txt.main.output.txt
tatcorpus2.sentences.apertium.tagged.txt.tags-uniq.output.txt.sorted.txt
tatcorpus2.sentences.apertium.tagged.txt.tags.output.txt
tatcorpus2.sentences.apertium.tagged.txt.united.output.txt
tatcorpus2.sentences.apertium.tagged.txt.words.output.txt
tatcorpus2.sentences.apertium.tagged.txt.words_case.output.txt
27.02.2017- Fastmorph Corpus Search Engineの5番目のバージョンがリリースされます。これで、メモリ(RAM)の約2,5倍の消費量が消費されます。
18.11.2016- Fastmorph Corpus Search Engineの第4バージョンがリリースされました。変更のリスト:
19.07.2016-複雑な形態検索エンジン「FastMorph」のいくつかの改善:
13.06.2016-単語機能の中央部で検索がFastMorphモジュールに追加されました。たとえば、 *ә× *を入力すると、urdesedです。
21.04.2016-「FastMorph」モジュールでの実装により、いくつかのプロセッサの最適化とマルチスレッドサポートのために、複雑な形態検索が最大5倍高速であることを達成しました。
03.04.2016-複雑な形態検索システムの機能が大幅に拡張されました。最大3.0以下のバージョンから更新されたガイドで、それらに関する詳細情報を入手できます。
22.02.2016-複雑な形態検索関数が書かれたタタールのコーパスに登場しました。ここでは、言葉フォーム、補題、文法タグ、単語の開始と終了、それらの間の距離などのパラメーターの異なる組み合わせを使用できます。技術情報:バージョン1は、116 MLNワードの発生で構成されるコーパスの約6 GBのRAMを消費します。その速度は非常に高いです。