|
3 | 3 | You can adapt this file completely to your liking, but it should at least
|
4 | 4 | contain the root `toctree` directive.
|
5 | 5 |
|
6 |
| -Welcome to rnlp's documentation! |
7 |
| -================================ |
| 6 | +``rnlp`` |
| 7 | +======== |
| 8 | + |
| 9 | + *Relational NLP Preprocessing*: A Python package and tool for converting text |
| 10 | + into a set of relational facts. |
| 11 | + |
| 12 | + :Authors: |
| 13 | + Kaushik Roy (`@kkroy36 <https://github.com/kkroy36/>`_), Alexander L. Hayes (`@batflyer <https://github.com/batflyer/>`_) |
| 14 | + |
| 15 | + :Index: :ref:`genindex` |
| 16 | + :Modules: :ref:`modindex` |
| 17 | + :Source: `GitHub <https://github.com/starling-lab/rnlp>`_ |
| 18 | + :Bugtracker: `GitHub Issues <https://github.com/starling-lab/rnlp/issues/>`_ |
| 19 | + |
| 20 | + .. image:: https://img.shields.io/pypi/pyversions/rnlp.svg?style=flat-square |
| 21 | + .. image:: https://img.shields.io/pypi/v/rnlp.svg?style=flat-square |
| 22 | + .. image:: https://img.shields.io/pypi/l/rnlp.svg?style=flat-square |
| 23 | + .. image:: https://img.shields.io/readthedocs/rnlp/stable.svg?flat-square |
| 24 | + :target: http://rnlp.readthedocs.io/en/stable/ |
8 | 25 |
|
9 | 26 | .. toctree::
|
10 | 27 | :maxdepth: 2
|
11 | 28 | :caption: Contents:
|
12 | 29 |
|
| 30 | +Installation |
| 31 | +------------ |
| 32 | + |
| 33 | +Stable builds on PyPi |
| 34 | + |
| 35 | +.. code-block:: bash |
| 36 | +
|
| 37 | + pip install rnlp |
| 38 | +
|
| 39 | +Development builds on GitHub |
| 40 | + |
| 41 | +.. code-block:: bash |
| 42 | +
|
| 43 | + pip install git+git://github.com/starling-lab/rnlp.git |
| 44 | +
|
| 45 | +Quick-Start |
| 46 | +----------- |
| 47 | + |
| 48 | +``rnlp`` can be used either as a CLI tool or as an imported Python Package. |
| 49 | + |
| 50 | ++---------------------------------------+--------------------------------------+ |
| 51 | +| **CLI** | **Imported** | |
| 52 | ++---------------------------------------+--------------------------------------+ |
| 53 | +|.. code-block:: bash |.. code-block:: python | |
| 54 | +| | | |
| 55 | +| $ python -m rnlp -f files/doi.txt | from rnlp.corpus import declaration | |
| 56 | +| | import rnlp | |
| 57 | +| | | |
| 58 | +| | doi = declaration() | |
| 59 | +| | rnlp.converter(doi) | |
| 60 | ++---------------------------------------+--------------------------------------+ |
| 61 | + |
| 62 | +Text will be converted into relational facts, relations encoded are: |
| 63 | + |
| 64 | +- between blocks of size 'n' (i.e. 2 sentences) in the blocks. |
| 65 | + |
| 66 | +- between block's of size n (i.e. 'n' sentences) and sentences in the blocks. |
| 67 | + |
| 68 | +- between sentences and words in the sentences. |
| 69 | + |
| 70 | +--- |
| 71 | + |
| 72 | +The relationships currently encoded are: |
| 73 | + |
| 74 | +1. earlySentenceInBlock - sentence occurs within a third of the block length |
| 75 | + |
| 76 | +2. earlyWordInSentence - word occurs within a third of the sentence length |
| 77 | + |
| 78 | +3. lateSentenceInBlock - sentence occurs after two-thirds of the block length |
| 79 | + |
| 80 | +4. midWayWordInSentence - word occurs between a third and two-thirds of the block length |
| 81 | + |
| 82 | +5. nextSentenceInBlock - sentence that follows a sentence in a block |
| 83 | + |
| 84 | +6. nextWordInSentence - word that follows a word in a sentence in a block |
| 85 | + |
| 86 | +7. sentenceInBlock - sentence occurs in a block |
| 87 | + |
| 88 | +8. wordInSentence - word occurs in a sentence. |
| 89 | + |
| 90 | +9. wordString - the string contained in the word. |
| 91 | + |
| 92 | +10. partOfSpeech - the part of speech of the word. |
| 93 | + |
| 94 | +--- |
| 95 | + |
| 96 | +Files contain a toy corpus (``files/``) and an image of a BoostSRL tree for predicting if a word in a sentence is the word "you". |
13 | 97 |
|
| 98 | +.. image:: https://raw.githubusercontent.com/starling-lab/rnlp/master/docs/img/output.png |
14 | 99 |
|
15 |
| -Indices and tables |
16 |
| -================== |
| 100 | +The tree says that if the word string contained in word 'b' is "you" then 'b' is the word "you". (This is of course true). |
| 101 | +A more interesting inference is the False branch that says that if word 'b' is an early word in sentence 'a' and word 'anon12035' is also an early word in sentence 'a' and if the word string contained in word 'anon12035' is "Thank", then the word 'b' has decent change of being the word "you". (The model was able to learn that the word "you" often occurs with the word "Thank" in the same sentence when "Thank" appears early in that sentence). |
17 | 102 |
|
18 |
| -* :ref:`genindex` |
19 |
| -* :ref:`modindex` |
20 |
| -* :ref:`search` |
| 103 | + .. _`@kkroy36`: https://github.com/kkroy36/ |
| 104 | + .. _`@batflyer`: https://github.com/batflyer/ |
0 commit comments