|
| 1 | +INSTALLATION AND USAGE GUIDE FOR AN@PHORA |
| 2 | + |
| 3 | +General overview |
| 4 | +================ |
| 5 | +Anap@ora is an open source system for detecting anaphoric chains in Russian texts. It takes raw text as an input and produces a list of anaphor-antecedent pairs. |
| 6 | +For details about what anaphora is, see https://en.wikipedia.org/wiki/Anaphora_(linguistics) or https://ru.wikipedia.org/wiki/%D0%90%D0%BD%D0%B0%D1%84%D0%BE%D1%80%D0%B0_%28%D0%BB%D0%B8%D0%BD%D0%B3%D0%B2%D0%B8%D1%81%D1%82%D0%B8%D0%BA%D0%B0%29 |
| 7 | + |
| 8 | +The system was built as a participant of anaphora resolution systems evaluation forum held at the conference 'Dialog – 2014' (http://dialog-21.ru). |
| 9 | +It is implemented in Python. Live demo is available using Brat on-line markup system [Stenetorp et al 2012] at http://ling.go.mail.ru/anaphora. |
| 10 | + |
| 11 | + |
| 12 | +Requirements |
| 13 | +============ |
| 14 | +To successfully run An@phora, you will need the following: |
| 15 | + |
| 16 | +1. Python (latest version of 2.7 branch is recommended) |
| 17 | + |
| 18 | +2. Freeling suite of language analyzers (http://nlp.lsi.upc.edu/freeling/). Latest version as of now is Freeling 3.1 |
| 19 | + |
| 20 | +3. The authors run An@phora on Linux, but theoretically it should work with MS Windows as well. |
| 21 | + |
| 22 | +Installation |
| 23 | +============ |
| 24 | +You need 3 Python scripts: anaphora.py, freeling.py and lemmatizer.py. |
| 25 | +Files prons.txt, reflexives.txt and relatives.txt provide lists of possible anaphoric expressions (in normal form). You can safely edit these lists, add your own words or remove those present. |
| 26 | + |
| 27 | +An@phora expects Freeling service to listen on port 50005 of localhost (can be changed in lemmatizer.py) and return morphological description of Russian texts. |
| 28 | +Once you have Freeling installed, you can run such a service with a command 'analyzer --server -p 50005 -f /usr/share/freeling/config/ru.cfg'. |
| 29 | +NB: original Freeling dictionaries contain some inconsistencies w.r.t. Russian language. This is not a problem for An@phora itself, but the quality of results will be worse. |
| 30 | +To avoid this, replace files dicc.src and probabilitas.dat in /usr/share/freeling/ru with the files we fixed manually (download from http://ling.go.mail.ru/freeling_ru_fixed.tar.gz). |
| 31 | + |
| 32 | +Usage |
| 33 | +===== |
| 34 | +General usage is simply 'anaphora.py + filename'. The file to analyze should be plain text in UTF-8. By default the system will output anaphoric chains in simple format with antecedents and anaphoric expressions separated with "<---": |
| 35 | +описания <--- оно pronoun |
| 36 | +комментариев <--- которые relative |
| 37 | +просто название <--- оно pronoun |
| 38 | + |
| 39 | +The last column describes the class of anaphoric expression. |
| 40 | + |
| 41 | +Two settings can be tuned with the second and the third arguments. Default state equals to: |
| 42 | + anaphora.py filename 23 plain, |
| 43 | +where '23' is the length of analysis window in words and 'plain' is the output format. |
| 44 | + |
| 45 | +One can increase analysis window length to improve detecting antecedents that are located far from their anaphors, at the expense of degrading precision, or vice versa. 23 words was shown empirically to be the best value w.r.t. F-measure. |
| 46 | + |
| 47 | +As fot the third argument, An@phora supports three output formats: plain, xml and brat. Plain output is shown above. XML output returns the same data in the format used at Dialog evaluation forum. It uses offsets in characters from the beginning of the text: |
| 48 | +<chain> |
| 49 | +<item sh="1778" ln="12" type="anaph"> |
| 50 | +<cont><![CDATA[комментариев]]></cont> |
| 51 | +</item> |
| 52 | +<item sh="1857" ln="7" comment="relative" type="anaph"> |
| 53 | +<cont><![CDATA[которые]]></cont> |
| 54 | +</item> |
| 55 | +</chain> |
| 56 | + |
| 57 | +Finally, brat output returns data in standoff format used by annotation files of Brat on-line markup system mentioned above: |
| 58 | +T1 antecedent 355 364 |
| 59 | +T2 pronoun 378 382 |
| 60 | +R1 anaphora Arg1:T2 Arg2:T1 |
| 61 | +T3 antecedent 1642 1650 |
| 62 | +T4 pronoun 1670 1673 |
| 63 | +R2 anaphora Arg1:T4 Arg2:T3 |
| 64 | +T5 antecedent 1778 1790 |
| 65 | +T6 relative 1857 1864 |
| 66 | +R3 anaphora Arg1:T6 Arg2:T5 |
| 67 | + |
| 68 | + |
| 69 | +There is another advanced feature of An@phora - using morphological analysis performed beforehand. One can analyze the files with his/her tool of choice, save the data using Freeling format and reuse it many times. |
| 70 | +Also, An@phora itself can save Freeling analysis to special annotation files correspondent to text files. |
| 71 | +To use this feature, one should replace in anaphora.py the string |
| 72 | + processed, curOffset = lemmatizer(res, startOffset = curOffset) |
| 73 | +with |
| 74 | + processed, curOffset = lemmatizer(res, startOffset = curOffset, loadFrom = argument) |
| 75 | +If for file under analysis there is a file with the same name and '.words' extension (e.g., 'test.txt.words' for 'test.txt'), then morhological analysis will be taken from this file. If it does not exist, Ap@phora will receive morphological analysis from Freeling service and save it in .words file. |
| 76 | +Freeling format follows the example below: |
| 77 | + ругательствам ругательство NCDPAI0000 1 33 |
| 78 | +The elements are: token, lemma, tagset (see http://nlp.lsi.upc.edu/freeling/doc/tagsets/tagset-ru.html), probability, offset. |
| 79 | + |
| 80 | +Authors |
| 81 | +======= |
| 82 | +An@phora was built by Max Ionov and Andrey Kutuzov, of applied linguistics team at Mail.ru search engine (http://go.mail.ru). |
| 83 | +You can reach authors by e-mail: [email protected], [email protected]. |
| 84 | +Details of the system are described in the paper "Influence of Morphology Processing Quality on Automated Anaphora Resolution for Russian", available online at http://ling.go.mail.ru/ionov_kutuzov_anaphora.pdf |
| 85 | + |
| 86 | +Copyright |
| 87 | +========= |
| 88 | +An@phora is distributed under the GNU public license. Please read the file LICENSE. |
0 commit comments