diff --git a/README.md b/README.md index 09eac95..b65c757 100644 --- a/README.md +++ b/README.md @@ -1,41 +1,11 @@ -# Integrated Semantic Framework (intsem.fx) +# Integrated Semantic Framework A Python 3 implementation of the [Integrated Semantic Framework](https://osf.io/9udjk/) that provides computational deep semantic analysis by combining structural semantics from construction grammars and lexical semantics from ontologies in a single representation. -# Install +`coolisf` is only a back-end semantic parsing module that runs on command-line interaface or in Python programs. +If you want a friendly graphical user interface, please use [visualkopasu](https://github.com/letuananh/visualkopasu/). -`coolisf` only works on Linux distributions at the moment (built and tested on Fedora and Ubuntu Linux). - -- Install `coolisf` package from [PyPI](https://pypi.org/project/coolisf/) using pip - -``` -pip install coolisf -``` - -- Create coolisf data folder at `/home/user/local/isf/data` -- Download ace-0.9.26 binary from https://osf.io/x52fy/ to `/home/user/bin/ace`. Make sure that you can run ace by - -```bash -[isf]$ ~/bin/ace -V -ACE version 0.9.26 -compiled at 18:48:50 on Sep 14 2017 -``` - -- Install [lelesk](https://pypi.org/project/lelesk/) and yawlib with data -- Download coolisf lexical rules database from https://osf.io/qn4wz/ and extract it to `/home/user/local/isf/data/lexrules.db` -- Download grammar files (erg.dat, jacy.dat, virgo.dat, etc.) and copy them to `/home/user/local/isf/data/grammars/` - -The final data folder should look something like this - -``` -/home/user/local/isf/data -├── grammars -│   ├── erg.dat -│   └── jacy.dat -├── lexrules.db -``` - -# Using ISF +## A quick glance To parse a sentence, use coolisf `text` command @@ -62,7 +32,7 @@ dmrs { ``` For batch processing, create a text file with each sentence on a separate line. -For example here is the content of the file `sample.txt` +For example here is the content of the file `demo.txt` ``` I drink green tea. @@ -71,10 +41,52 @@ A soul is not a living thing. Do you have any green tea chest? ``` -After that, run the following command and the output will be written to the file `demo_out.xml` +After that, run the following `parse` command to analyse the text and write the output to `demo_out.xml` ```bash python -m coolisf parse demo.txt -o demo_out.xml ``` -If you encounter any issue, please submit an issue at: https://github.com/letuananh/intsem.fx/issues +Here is an example of using coolisf in a Python code + +```python +from coolisf import GrammarHub +ghub = GrammarHub() +# parse an English text +sent = ghub.ERG_ISF.parse("I love drip coffee.") +# print semantic structures for all potential readings +for reading in sent: + print(reading.dmrs()) +``` + +Output + +```bash +dmrs { + 10000 [pron<0:1> x ind=+ num=sg pers=1 pt=std]; + 10001 [pronoun_q<0:1> x ind=+ num=sg pers=1 pt=std]; + 10002 [_love_v_1_rel<2:6> e mood=indicative perf=- prog=- sf=prop tense=pres]; + 10003 [udef_q<7:19> x num=sg pers=3]; + 10004 [_drip+coffee_n_1_rel<7:19> x num=sg pers=3]; + 0:/H -> 10002; + 10001:RSTR/H -> 10000; + 10002:ARG1/NEQ -> 10000; + 10002:ARG2/NEQ -> 10004; + 10003:RSTR/H -> 10004; +} +... +``` + +Fore more information, please refer to the documentation for coolisf at https://coolisf.readthedocs.io + +## Install + +The `coolisf` package itself is available on [PyPI](https://pypi.org/project/coolisf/) and it can be installed using pip + +```bash +pip install coolisf +``` + +However, it can be tricky to acquire all the required components and data. Please find version specific prerequisites and installation instructions on coolisf's [official Github release page](https://github.com/letuananh/intsem.fx/releases). + +If you encounter any problems or difficulties, please submit a ticket for support at: https://github.com/letuananh/intsem.fx/issues diff --git a/coolisf/__version__.py b/coolisf/__version__.py index 40502a6..bda7d18 100644 --- a/coolisf/__version__.py +++ b/coolisf/__version__.py @@ -14,6 +14,6 @@ __issue__ = "https://github.com/letuananh/intsem.fx/" __maintainer__ = "Le Tuan Anh" __version_major__ = "0.2.3" # follow PEP-0440 -__version__ = "{}rc".format(__version_major__) -__version_long__ = "{} - Release Candidate".format(__version_major__) -__status__ = "4 - Beta" +__version__ = "{}".format(__version_major__) +__version_long__ = "{}".format(__version_major__) +__status__ = "5 - Production/Stable"