Skip to main content

A Python 3 implementation of the Integrated Semantic Framework that provides computational deep semantic analysis by combining structural semantics from construction grammars and lexical semantics from ontologies in a single representation.

Project description

Integrated Semantic Framework

A Python 3 implementation of the Integrated Semantic Framework that provides computational deep semantic analysis by combining structural semantics from construction grammars and lexical semantics from ontologies in a single representation.

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.

A quick glance

To parse a sentence, use coolisf text command

python -m coolisf text "I drink green tea." -f dmrs

:`I drink green tea.` (len=5)
------------------------------------------------------------
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 [_drink_v_1_rel<2:7> e mood=indicative perf=- prog=- sf=prop tense=pres];
  10003 [udef_q<8:18> x num=sg pers=3];
  10004 [_green+tea_n_1_rel<8:18> x num=sg pers=3];
  0:/H -> 10002;
  10001:RSTR/H -> 10000;
  10002:ARG1/NEQ -> 10000;
  10002:ARG2/NEQ -> 10004;
  10003:RSTR/H -> 10004;
}
# 10002 -> 01170052-v[drink/lelesk]
# 10004 -> 07935152-n[green tea/lelesk]
...

For batch processing, create a text file with each sentence on a separate line. For example here is the content of the file demo.txt

I drink green tea.
Sherlock Holmes has three guard dogs.
A soul is not a living thing.
Do you have any green tea chest?

After that, run the following parse command to analyse the text and write the output to demo_out.xml

python -m coolisf parse demo.txt -o demo_out.xml

Here is an example of using coolisf in a Python code

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

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 and it can be installed using pip

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.

If you encounter any problems or difficulties, please submit a ticket for support at: https://github.com/letuananh/intsem.fx/issues

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coolisf-0.2.3.tar.gz (734.1 kB view details)

Uploaded Source

File details

Details for the file coolisf-0.2.3.tar.gz.

File metadata

  • Download URL: coolisf-0.2.3.tar.gz
  • Upload date:
  • Size: 734.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.9

File hashes

Hashes for coolisf-0.2.3.tar.gz
Algorithm Hash digest
SHA256 44b4c5f9ab93a1dc5c9c9d58c8711b0f810d02f2de4d61627c8965f0b9260cc3
MD5 cb74da4f2c1243d6728fe1e170cd65e9
BLAKE2b-256 66fb6a8734faa93e90832f60f38edfc5deb6c9c7a114313eac3bd987b8fef887

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page