From cabc25a9fbba4bd1584342f8a278966ed7ad5d46 Mon Sep 17 00:00:00 2001 From: Le Tuan Anh Date: Sun, 9 May 2021 15:56:33 +0800 Subject: [PATCH 01/14] modify logging.json --- logging.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/logging.json b/logging.json index 5872d27..57be877 100644 --- a/logging.json +++ b/logging.json @@ -46,7 +46,8 @@ ,"coolisf.morph": {"level": "INFO"} ,"coolisf.mappings.predsense": {"level": "INFO"} ,"puchikarui": { "leveL": "INFO"} - ,"lelesk": { "level": "INFO" } + ,"lelesk": { "level": "WARNING" } + ,"yawlib.glosswordnet": { "level": "WARNING" } ,"delphin.interfaces.ace": { "disabled": "yes", "propagate": "no" } }, From 83b5f68cac12c884a66e7b2ea896d7eb1681ad86 Mon Sep 17 00:00:00 2001 From: Le Tuan Anh Date: Sun, 9 May 2021 19:31:53 +0800 Subject: [PATCH 02/14] add eval scripts --- eval_imi.sh | 40 ++++++++++++++++++++++++++++++++++++++++ eval_semeval.bak.sh | 8 ++++++++ eval_semeval.sh | 8 ++++++++ 3 files changed, 56 insertions(+) create mode 100755 eval_imi.sh create mode 100755 eval_semeval.bak.sh create mode 100755 eval_semeval.sh diff --git a/eval_imi.sh b/eval_imi.sh new file mode 100755 index 0000000..44caf58 --- /dev/null +++ b/eval_imi.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +echo "| Profile | Tokenizer | Recall | Precision | F1 |" +echo "|-----------------+-----------+--------+-----------+--------|" +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/ukb/speckled_r26463_isf_ukb.ttl.json.gz --ignore data/ukb/speckled_r26463_isf_ukb_noparse.txt --debug data/ukb/speckled_r26463_isf_ukb_debug.txt --ttl_format json --nonsense -q --batch --org --cols "Dan/ISF/UKB" "Dan/ISF" +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/ukb/speckled_ro26463_isf_ukb.ttl.json.gz --ignore data/ukb/speckled_ro26463_isf_ukb_noparse.txt --debug data/ukb/speckled_ro26463_isf_ukb_debug.txt --ttl_format json --nonsense -q --batch --org --cols "DanRo/ISF/UKB" "DanRo/ISF" +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/ace/silver_isf_lesk.ttl.json.gz --debug data/ace/silver_isf_lesk_debug.txt --ignore data/ace/silver_isf_lesk_noparse.txt -q --nonsense --batch --org --cols "ERG/ISF" "ERG/ISF" --ttl_format json +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/ace/silver_lesk.ttl.json.gz --debug data/ace/silver_lesk_debug.txt --ignore data/ace/silver_lesk_noparse.txt -q --nonsense --batch --org --cols "ERG" "ERG" --ttl_format json +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/shallow/speckled_bb_wn.ttl.json.gz --debug data/shallow/speckled_bb_wn_debug.txt --ttl_format json --nonsense -q --batch --org --cols "Babelfy" "Babelfy" +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/shallow/speckled_ukb.ttl.json.gz --debug data/shallow/speckled_ukb_debug.txt --ttl_format json --nonsense -q --batch --org --cols "UKB" "Stanford" + +echo "" +echo "*LESK - Best of each*" +echo "| Profile | Tokenizer | Recall | Precision | F1 |" +echo "|-----------------+-----------+--------+-----------+--------|" +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/isf/speckled_ro26463_isf_lesk.ttl.json.gz --debug data/isf/speckled_ro26463_isf_lesk_debug.txt -q --ignore data/isf/speckled_ro26463_isf_lesk_noparse.txt --nonsense --batch --org --cols "Dan/bridge/ISF" "Dan/bridge/ISF" --batch --ttl_format json +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/isf/speckled_r26463_isf_lesk.ttl.json.gz --debug data/isf/speckled_r26463_isf_lesk_debug.txt -q --ignore data/isf/speckled_r26463_isf_lesk_noparse.txt --nonsense --batch --org --cols "Dan/ISF" "Dan/ISF" --ttl_format json +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/isf/speckled_ro26463_lesk.ttl.json.gz --debug data/isf/speckled_ro26463_lesk_debug.txt -q --ignore data/isf/speckled_ro26463_lesk_noparse.txt --nonsense --batch --org --cols "Dan/bridge" "Dan/bridge" --ttl_format json +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/isf/speckled_r26463_lesk.ttl.json.gz --debug data/isf/speckled_r26463_lesk_debug.txt -q --ignore data/isf/speckled_r26463_lesk_noparse.txt --nonsense --batch --org --cols "Dan" "Dan" --ttl_format json +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/ace/silver_isf_lesk.ttl.json.gz --debug data/ace/silver_isf_lesk_debug.txt --ignore data/ace/silver_isf_lesk_noparse.txt -q --nonsense --batch --org --cols "ERG/ISF" "ERG/ISF" --ttl_format json +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/ace/silver_lesk.ttl.json.gz --debug data/ace/silver_lesk_debug.txt --ignore data/ace/silver_lesk_noparse.txt -q --nonsense --batch --org --cols "ERG" "ERG" --ttl_format json +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/shallow/speckled_lesk.ttl.json.gz --debug data/shallow/speckled_lesk_debug.txt --ttl_format json --nonsense -q --batch --org --cols "NLTK" "NLTK" --ttl_format json +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/shallow/speckled_stanford_lesk.ttl.json.gz --debug data/shallow/speckled_stanford_lesk_debug.txt --nonsense -q --batch --org --cols "Stanford tagger" "Stanford tagger" --ttl_format json +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/shallow/speckled_ukb.ttl.json.gz --debug data/shallow/speckled_ukb_debug.txt --ttl_format json --nonsense -q --batch --org --cols "UKB" "Stanford" +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/shallow/speckled_bb_wn.ttl.json.gz --debug data/shallow/speckled_bb_wn_debug.txt --ttl_format json --nonsense -q --batch --org --cols "Babelfy" "Babelfy" + +echo "" +echo "*MFS - Best of each*" +echo "| Profile | Recall | Precision | F1 |" +echo "|-----------------+--------+-----------+--------|" +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/isf/speckled_ro26463_isf_mfs.ttl.json.gz --debug data/isf/speckled_ro26463_isf_mfs_debug.txt -q --ignore data/isf/speckled_ro26463_noparse.txt --nonsense --batch --org --cols "Dan/bridge/ISF" "Dan/bridge/ISF" --batch --ttl_format json +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/isf/speckled_r26463_isf_mfs.ttl.json.gz --debug data/isf/speckled_r26463_isf_mfs_debug.txt -q --ignore data/isf/speckled_r26463_noparse.txt --nonsense --batch --org --cols "Dan/ISF" "Dan/ISF" --ttl_format json +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/isf/speckled_ro26463_mfs.ttl.json.gz --debug data/isf/speckled_ro26463_mfs_debug.txt -q --ignore data/isf/speckled_ro26463_noparse.txt --nonsense --batch --org --cols "Dan/bridge" "Dan/bridge" --ttl_format json +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/isf/speckled_r26463_mfs.ttl.json.gz --debug data/isf/speckled_r26463_mfs_debug.txt -q --ignore data/isf/speckled_r26463_noparse.txt --nonsense --batch --org --cols "Dan" "Dan" --ttl_format json +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/ace/silver_isf_mfs.ttl.json.gz --debug data/ace/silver_isf_mfs_debug.txt --ignore data/ace/silver_isf_mfs_noparse.txt -q --nonsense --batch --org --cols "ERG/ISF" "ERG/ISF" --ttl_format json +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/ace/silver_mfs.ttl.json.gz --debug data/ace/silver_mfs_debug.txt --ignore data/ace/silver_mfs_noparse.txt -q --nonsense --batch --org --cols "ERG" "ERG" --ttl_format json +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/shallow/speckled_mfs.ttl.json.gz --debug data/shallow/speckled_mfs_debug.txt --ttl_format json --nonsense -q --batch --org --cols "NLTK" "NLTK" --ttl_format json +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/shallow/speckled_stanford_mfs.ttl.json.gz --debug data/shallow/speckled_stanford_mfs_debug.txt --nonsense -q --batch --org --cols "Stanford tagger" "Stanford tagger" --ttl_format json +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/shallow/speckled_ukb.ttl.json.gz --debug data/shallow/speckled_ukb_debug.txt --ttl_format json --nonsense -q --batch --org --cols "UKB" "Stanford" +python -W ignore -m isftk.ttl cmp -g data/gold/gold_imi.ttl.json.gz -p data/shallow/speckled_bb_wn.ttl.json.gz --debug data/shallow/speckled_bb_wn_debug.txt --ttl_format json --nonsense -q --batch --org --cols "Babelfy" "Babelfy" diff --git a/eval_semeval.bak.sh b/eval_semeval.bak.sh new file mode 100755 index 0000000..f75d1b5 --- /dev/null +++ b/eval_semeval.bak.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +python3 -W ignore -m isftk.ttl cmp -g data/semeval/gold.ttl.json.gz -p data/semeval/semeval_isf_lesk.ttl.json.gz --debug data/semeval/semeval_isf_lesk_debug.txt --ignore data/semeval/semeval_isf_lesk_noparse.txt --nonsense -q --ttl_format json --batch --org --cols "ISF/LESK" +python3 -W ignore -m isftk.ttl cmp -g data/semeval/gold.ttl.json.gz -p data/semeval/semeval_isf_mfs.ttl.json.gz --debug data/semeval/semeval_isf_mfs_debug.txt --ignore data/semeval/semeval_isf_mfs_noparse.txt --nonsense -q --ttl_format json --org --batch --cols "ISF/MFS" +python3 -W ignore -m isftk.ttl cmp -g data/semeval/gold.ttl.json.gz -p data/semeval/semeval_ace_lesk.ttl.json.gz --debug data/semeval/semeval_ace_lesk_debug.txt --ignore data/semeval/semeval_ace_lesk_noparse.txt --nonsense -q --ttl_format json --batch --org --cols "ACE/LESK" +python3 -W ignore -m isftk.ttl cmp -g data/semeval/gold.ttl.json.gz -p data/semeval/semeval_ace_mfs.ttl.json.gz --debug data/semeval/semeval_ace_mfs_debug.txt --ignore data/semeval/semeval_ace_mfs_noparse.txt --nonsense -q --ttl_format json --batch --cols "ACE/MFS" --org +python3 -W ignore -m isftk.ttl cmp -g data/semeval/gold.ttl.json.gz -p data/semeval/semeval_ukb.ttl.json.gz --debug data/semeval/semeval_ukb_debug.txt --nonsense -q --ttl_format json --org --batch --cols "UKB" + diff --git a/eval_semeval.sh b/eval_semeval.sh new file mode 100755 index 0000000..36caa61 --- /dev/null +++ b/eval_semeval.sh @@ -0,0 +1,8 @@ +#!/bin/bash +echo "| Profile | Tokenizer | Recall | Precision | F1 |" +echo "|-----------------+-----------+--------+-----------+--------|" +python3 -W ignore -m isftk.ttl cmp -g data/semeval/gold.ttl.json.gz -p data/semeval/semeval_isf_lesk.ttl.json.gz --debug data/semeval/semeval_isf_lesk_debug.txt --ignore data/semeval/semeval_isf_lesk_noparse.txt --nonsense -q --ttl_format json --batch --org --cols "ISF/Lesk" "ERG" +python3 -W ignore -m isftk.ttl cmp -g data/semeval/gold.ttl.json.gz -p data/semeval/semeval_isf_mfs.ttl.json.gz --debug data/semeval/semeval_isf_mfs_debug.txt --ignore data/semeval/semeval_isf_mfs_noparse.txt --nonsense -q --ttl_format json --batch --org --cols "ISF/MFS" "ERG" +python3 -W ignore -m isftk.ttl cmp -g data/semeval/gold.ttl.json.gz -p data/semeval/semeval_ace_lesk.ttl.json.gz --debug data/semeval/semeval_ace_lesk_debug.txt --ignore data/semeval/semeval_ace_lesk_noparse.txt --nonsense -q --ttl_format json --batch --org --cols "ERG/Lesk" "ERG" +python3 -W ignore -m isftk.ttl cmp -g data/semeval/gold.ttl.json.gz -p data/semeval/semeval_ace_mfs.ttl.json.gz --debug data/semeval/semeval_ace_mfs_debug.txt --ignore data/semeval/semeval_ace_mfs_noparse.txt --nonsense -q --ttl_format json --batch --org --cols "ERG/MFS" "ERG" +python3 -W ignore -m isftk.ttl cmp -g data/semeval/gold.ttl.json.gz -p data/semeval/semeval_ukb.ttl.json.gz --debug data/semeval/semeval_ukb_debug.txt --nonsense -q --ttl_format json --batch --org --cols "UKB" "Gold" From 0da81021606f9a787d4c72e6ef9f5e2e187810e7 Mon Sep 17 00:00:00 2001 From: Le Tuan Anh Date: Sun, 9 May 2021 21:16:00 +0800 Subject: [PATCH 03/14] clean up dependencies --- config.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/config.sh b/config.sh index fba8338..88badff 100755 --- a/config.sh +++ b/config.sh @@ -41,9 +41,7 @@ git submodule init && git submodule update # prerequisite packages pip install -r requirements.txt -qq -link_folder `readlink -f ./modules/lelesk/lelesk` lelesk link_folder `readlink -f ./modules/demophin` demophin -link_folder `readlink -f ./modules/yawlib/yawlib` yawlib link_file `readlink -f ${WORKSPACE_FOLDER}/cldata/erg.dat` data/erg.dat link_file `readlink -f ${WORKSPACE_FOLDER}/cldata/jacy.dat` data/jacy.dat From f19a4b519cd0b0b7bc9ce18e95339848ba8ef33d Mon Sep 17 00:00:00 2001 From: Le Tuan Anh Date: Sun, 9 May 2021 21:16:58 +0800 Subject: [PATCH 04/14] use texttaglib embedded chirptext & puchikarui --- coolisf/common.py | 2 +- coolisf/config.py | 2 +- coolisf/dao/cache.py | 2 +- coolisf/dao/corpus.py | 4 ++-- coolisf/dao/ruledb.py | 2 +- coolisf/dao/textcorpus.py | 4 ++-- coolisf/ergex.py | 12 ++++++------ coolisf/ghub.py | 2 +- coolisf/gold_extract.py | 6 +++--- coolisf/lexsem.py | 2 +- coolisf/main.py | 8 ++++---- coolisf/model.py | 6 +++--- coolisf/morph.py | 2 +- coolisf/processors/jp_adv.py | 4 ++-- coolisf/processors/jp_basic.py | 2 +- coolisf/shallow.py | 6 +++--- coolisf/util.py | 2 +- test/__init__.py | 2 +- test/test_coolisf.py | 4 ++-- test/test_corpus_dao.py | 2 +- test/test_ghub.py | 2 +- test/test_goldgen.py | 4 ++-- test/test_lexsem.py | 2 +- test/test_miner.py | 2 +- test/test_model.py | 4 ++-- test/test_prep.py | 2 +- test/test_tools.py | 2 +- 27 files changed, 47 insertions(+), 47 deletions(-) diff --git a/coolisf/common.py b/coolisf/common.py index b0adf07..9e1e68c 100644 --- a/coolisf/common.py +++ b/coolisf/common.py @@ -39,7 +39,7 @@ import gzip import logging -from chirptext import FileHelper +from texttaglib.chirptext import FileHelper from lelesk.util import ptpos_to_wn diff --git a/coolisf/config.py b/coolisf/config.py index 3be9ee1..c76cb17 100644 --- a/coolisf/config.py +++ b/coolisf/config.py @@ -42,7 +42,7 @@ import os import logging -from chirptext import FileHelper, AppConfig +from texttaglib.chirptext import FileHelper, AppConfig from coolisf.common import write_file from coolisf.data import read_config_template diff --git a/coolisf/dao/cache.py b/coolisf/dao/cache.py index 4097953..7bf465e 100644 --- a/coolisf/dao/cache.py +++ b/coolisf/dao/cache.py @@ -36,7 +36,7 @@ import logging import json -from puchikarui import Schema, with_ctx +from texttaglib.puchikarui import Schema, with_ctx from coolisf.model import Sentence diff --git a/coolisf/dao/corpus.py b/coolisf/dao/corpus.py index 9548715..6aafb5d 100755 --- a/coolisf/dao/corpus.py +++ b/coolisf/dao/corpus.py @@ -35,8 +35,8 @@ import os.path import logging -from puchikarui import Schema, with_ctx -from chirptext import texttaglib as ttl +from texttaglib.puchikarui import Schema, with_ctx +from texttaglib.chirptext import ttl from coolisf.util import is_valid_name from coolisf.model import Corpus, Document, Sentence, Reading diff --git a/coolisf/dao/ruledb.py b/coolisf/dao/ruledb.py index 12493c7..e9c6fc7 100644 --- a/coolisf/dao/ruledb.py +++ b/coolisf/dao/ruledb.py @@ -32,7 +32,7 @@ import os.path import logging -from puchikarui import with_ctx +from texttaglib.puchikarui import with_ctx from coolisf.dao import CorpusDAOSQLite from coolisf.model import LexUnit, RuleInfo, PredInfo, RulePred, Reading diff --git a/coolisf/dao/textcorpus.py b/coolisf/dao/textcorpus.py index 3646277..1165da1 100644 --- a/coolisf/dao/textcorpus.py +++ b/coolisf/dao/textcorpus.py @@ -31,8 +31,8 @@ import os import json -from chirptext import FileHelper -from chirptext.chio import CSV +from texttaglib.chirptext import FileHelper +from texttaglib.chirptext.chio import CSV # ---------------------------------------------------------------------- diff --git a/coolisf/ergex.py b/coolisf/ergex.py index cc53454..45ece64 100755 --- a/coolisf/ergex.py +++ b/coolisf/ergex.py @@ -38,12 +38,12 @@ from collections import defaultdict import csv -from chirptext.leutile import Counter -from chirptext.leutile import FileHelper -from chirptext.leutile import TextReport -from chirptext.leutile import FileHub -from chirptext.leutile import Timer -from chirptext.leutile import header +from texttaglib.chirptext.leutile import Counter +from texttaglib.chirptext.leutile import FileHelper +from texttaglib.chirptext.leutile import TextReport +from texttaglib.chirptext.leutile import FileHub +from texttaglib.chirptext.leutile import Timer +from texttaglib.chirptext.leutile import header from yawlib import YLConfig from yawlib import WordnetSQL as WNSQL diff --git a/coolisf/ghub.py b/coolisf/ghub.py index 23d8ea6..85529b2 100644 --- a/coolisf/ghub.py +++ b/coolisf/ghub.py @@ -42,7 +42,7 @@ import logging from delphin.interfaces import ace -from chirptext import FileHelper +from texttaglib.chirptext import FileHelper from coolisf.config import read_config from coolisf.dao.cache import AceCache, ISFCache diff --git a/coolisf/gold_extract.py b/coolisf/gold_extract.py index e23aa26..8378069 100755 --- a/coolisf/gold_extract.py +++ b/coolisf/gold_extract.py @@ -45,9 +45,9 @@ from lxml import etree -from chirptext.leutile import FileHelper -from chirptext import texttaglib as ttl -from chirptext import chio +from texttaglib.chirptext.leutile import FileHelper +from texttaglib.chirptext import texttaglib as ttl +from texttaglib.chirptext import chio from lelesk import LeLeskWSD from lelesk import LeskCache # WSDResources diff --git a/coolisf/lexsem.py b/coolisf/lexsem.py index 1bcd951..d3ae8e9 100644 --- a/coolisf/lexsem.py +++ b/coolisf/lexsem.py @@ -35,7 +35,7 @@ from delphin.mrs.components import Pred -from chirptext import texttaglib as ttl +from texttaglib.chirptext import texttaglib as ttl from yawlib import SynsetID diff --git a/coolisf/main.py b/coolisf/main.py index 1236386..a61c6b6 100755 --- a/coolisf/main.py +++ b/coolisf/main.py @@ -46,10 +46,10 @@ import logging import collections -from chirptext.cli import CLIApp, setup_logging -from chirptext import header, confirm, TextReport, FileHelper, Counter, Timer -from chirptext.leutile import is_number -from chirptext import texttaglib as ttl +from texttaglib.chirptext.cli import CLIApp, setup_logging +from texttaglib.chirptext import header, confirm, TextReport, FileHelper, Counter, Timer +from texttaglib.chirptext.leutile import is_number +from texttaglib.chirptext import texttaglib as ttl from lelesk import LeLeskWSD from lelesk import LeskCache # WSDResources diff --git a/coolisf/model.py b/coolisf/model.py index e1431d0..9702391 100644 --- a/coolisf/model.py +++ b/coolisf/model.py @@ -51,9 +51,9 @@ from delphin.mrs.components import Pred from delphin.mrs.components import normalize_pred_string -from chirptext.anhxa import update_obj -from chirptext.leutile import StringTool, header -from chirptext import texttaglib as ttl +from texttaglib.chirptext.anhxa import update_obj +from texttaglib.chirptext.leutile import StringTool, header +from texttaglib.chirptext import texttaglib as ttl from yawlib import Synset from lelesk import LeLeskWSD from lelesk import LeskCache # WSDResources diff --git a/coolisf/morph.py b/coolisf/morph.py index 7f4cf5c..116d03b 100644 --- a/coolisf/morph.py +++ b/coolisf/morph.py @@ -34,7 +34,7 @@ import logging from collections import defaultdict as dd -from chirptext import FileHelper +from texttaglib.chirptext import FileHelper from coolisf.dao.ruledb import LexRuleDB from coolisf.config import read_config diff --git a/coolisf/processors/jp_adv.py b/coolisf/processors/jp_adv.py index 1a7f2ab..f66d007 100644 --- a/coolisf/processors/jp_adv.py +++ b/coolisf/processors/jp_adv.py @@ -33,13 +33,13 @@ import logging -from chirptext import TextReport +from texttaglib.chirptext import TextReport from coolisf.model import Sentence from .base import Processor try: - from chirptext.deko import wakati + from texttaglib.chirptext.deko import wakati from coolisf.shallow import JapaneseAnalyser from jamdict import Jamdict from jamdict.tools import dump_result diff --git a/coolisf/processors/jp_basic.py b/coolisf/processors/jp_basic.py index c07358c..7bd9185 100644 --- a/coolisf/processors/jp_basic.py +++ b/coolisf/processors/jp_basic.py @@ -37,7 +37,7 @@ from .base import Processor try: - from chirptext.deko import wakati + from texttaglib.chirptext.deko import wakati from coolisf.shallow import JapaneseAnalyser except: logging.warning('chirptext.deko cannot be imported. JNLP mode is disabled') diff --git a/coolisf/shallow.py b/coolisf/shallow.py index 7eb676c..16ca561 100644 --- a/coolisf/shallow.py +++ b/coolisf/shallow.py @@ -35,10 +35,10 @@ import nltk from nltk.stem import WordNetLemmatizer -from chirptext import texttaglib as ttl +from texttaglib.chirptext import texttaglib as ttl try: - from chirptext.deko import txt2mecab - from chirptext.deko import tokenize as deko_tokenize + from texttaglib.chirptext.deko import txt2mecab + from texttaglib.chirptext.deko import tokenize as deko_tokenize except: logging.warning("Deko cannot be imported. JapaneseAnalyser will not function properly") diff --git a/coolisf/util.py b/coolisf/util.py index af68ad2..0bd449e 100644 --- a/coolisf/util.py +++ b/coolisf/util.py @@ -39,7 +39,7 @@ import re import logging -from chirptext import Counter, FileHelper +from texttaglib.chirptext import Counter, FileHelper from coolisf.model import Sentence, Document diff --git a/test/__init__.py b/test/__init__.py index faa5199..1f5b34a 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -23,7 +23,7 @@ # Homepage: https://github.com/letuananh/intsem.fx import os -from chirptext.cli import setup_logging +from texttaglib.chirptext.cli import setup_logging TEST_DIR = os.path.dirname(__file__) TEST_DATA = os.path.join(TEST_DIR, 'data') diff --git a/test/test_coolisf.py b/test/test_coolisf.py index d5d4e5a..da54658 100755 --- a/test/test_coolisf.py +++ b/test/test_coolisf.py @@ -45,8 +45,8 @@ import logging from collections import defaultdict as dd -from chirptext import FileHelper, header, TextReport -from chirptext import texttaglib as ttl +from texttaglib.chirptext import FileHelper, header, TextReport +from texttaglib.chirptext import ttl from lelesk import LeLeskWSD, LeskCache from yawlib import YLConfig, WordnetSQL as WSQL diff --git a/test/test_corpus_dao.py b/test/test_corpus_dao.py index 2c84e8a..152643a 100644 --- a/test/test_corpus_dao.py +++ b/test/test_corpus_dao.py @@ -40,7 +40,7 @@ import logging import unittest -from chirptext import texttaglib as ttl +from texttaglib.chirptext import ttl from coolisf.util import sent2json from coolisf import GrammarHub from coolisf.dao import CorpusDAOSQLite diff --git a/test/test_ghub.py b/test/test_ghub.py index 492b493..a7af9bf 100644 --- a/test/test_ghub.py +++ b/test/test_ghub.py @@ -40,7 +40,7 @@ import unittest import logging -from chirptext import header +from texttaglib.chirptext import header import chirptext.texttaglib as ttl from coolisf import GrammarHub from coolisf.model import Document diff --git a/test/test_goldgen.py b/test/test_goldgen.py index 1073cb1..2863fd6 100644 --- a/test/test_goldgen.py +++ b/test/test_goldgen.py @@ -44,8 +44,8 @@ from lxml import etree from delphin.mrs.components import Pred -from chirptext import header, Counter, TextReport -from chirptext import texttaglib as ttl +from texttaglib.chirptext import header, Counter, TextReport +from texttaglib.chirptext import texttaglib as ttl from coolisf import tag_gold, Lexsem from coolisf.lexsem import import_shallow from coolisf.gold_extract import build_root_node diff --git a/test/test_lexsem.py b/test/test_lexsem.py index 547761b..35d60d2 100644 --- a/test/test_lexsem.py +++ b/test/test_lexsem.py @@ -45,7 +45,7 @@ import unittest import logging -from chirptext import texttaglib as ttl +from texttaglib.chirptext import texttaglib as ttl from coolisf import GrammarHub from coolisf.model import Document, Sentence, Predicate from coolisf.lexsem import Lexsem, import_shallow, taggable_eps diff --git a/test/test_miner.py b/test/test_miner.py index 0b84cda..07904b4 100644 --- a/test/test_miner.py +++ b/test/test_miner.py @@ -40,7 +40,7 @@ import unittest import logging -from chirptext import header +from texttaglib.chirptext import header from yawlib import YLConfig from yawlib.omwsql import OMWSQL diff --git a/test/test_model.py b/test/test_model.py index 6e43ec1..bab28c0 100644 --- a/test/test_model.py +++ b/test/test_model.py @@ -40,8 +40,8 @@ import unittest import logging -from chirptext import header -from chirptext import texttaglib as ttl +from texttaglib.chirptext import header +from texttaglib.chirptext import texttaglib as ttl from coolisf import GrammarHub from coolisf.util import is_valid_name, sent2json diff --git a/test/test_prep.py b/test/test_prep.py index 46089e5..502dee8 100644 --- a/test/test_prep.py +++ b/test/test_prep.py @@ -40,7 +40,7 @@ import unittest import coolisf import logging -from chirptext import texttaglib as ttl +from texttaglib.chirptext import texttaglib as ttl from coolisf.model import Reading from coolisf import GrammarHub from coolisf.processors import ProcessorManager diff --git a/test/test_tools.py b/test/test_tools.py index f894690..d8d5700 100644 --- a/test/test_tools.py +++ b/test/test_tools.py @@ -45,7 +45,7 @@ import unittest import logging -from chirptext import texttaglib as ttl +from texttaglib.chirptext import texttaglib as ttl from coolisf import read_config from coolisf import GrammarHub from coolisf.common import overlap, tags_to_concepts From 21d13c23c2c85ed0d2fec805f8b7297534bd9d09 Mon Sep 17 00:00:00 2001 From: Le Tuan Anh Date: Sun, 9 May 2021 21:17:11 +0800 Subject: [PATCH 05/14] update package requirement file --- requirements.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/requirements.txt b/requirements.txt index 797d47e..5bcee2f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,8 @@ -lxml>=3.7.2 -bs4 pydelphin==0.6.0 -nltk==3.2.1 -fuzzywuzzy>=0.15.1 -python-Levenshtein -texttaglib>=0.1.1a1 +nltk==3.6.2 +texttaglib>=0.1.1a1, < 0.2 +yawlib>=0.1a3, < 0.2 +lelesk>=0.1a1, < 0.2 + +lxml +beautifulsoup4 From f07ac8348b2ff5c652f4a2444f1d278975e70d94 Mon Sep 17 00:00:00 2001 From: Le Tuan Anh Date: Sun, 9 May 2021 21:17:22 +0800 Subject: [PATCH 06/14] use /bin/bash --- test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.sh b/test.sh index 73781e9..afa9c1b 100755 --- a/test.sh +++ b/test.sh @@ -1,4 +1,4 @@ -#!/usr/bin/sh +#!/bin/bash echo "Test script" # Alternative: test a specific file From 441ca42c151cd54f966958a3da643caad1b9d768 Mon Sep 17 00:00:00 2001 From: Le Tuan Anh Date: Sun, 9 May 2021 21:17:40 +0800 Subject: [PATCH 07/14] fuzzywuzzy and Levenshtein are optional --- requirements-dev.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 requirements-dev.txt diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..a65b700 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,2 @@ +fuzzywuzzy>=0.15.1 +python-Levenshtein From 18c4ebe8c11405332a5d61b6fee7d99f43ae48de Mon Sep 17 00:00:00 2001 From: Le Tuan Anh Date: Sun, 9 May 2021 21:35:45 +0800 Subject: [PATCH 08/14] debug secret key --- {djangoisf => coolisf/rest}/__init__.py | 0 {djangoisf => coolisf/rest}/admin.py | 0 {djangoisf => coolisf/rest}/apps.py | 0 {djangoisf => coolisf/rest}/migrations/__init__.py | 0 {djangoisf => coolisf/rest}/models.py | 0 {djangoisf => coolisf/rest}/tests.py | 0 {djangoisf => coolisf/rest}/urls.py | 0 {djangoisf => coolisf/rest}/views.py | 0 djangoisfsite/settings.py | 2 +- 9 files changed, 1 insertion(+), 1 deletion(-) rename {djangoisf => coolisf/rest}/__init__.py (100%) rename {djangoisf => coolisf/rest}/admin.py (100%) rename {djangoisf => coolisf/rest}/apps.py (100%) rename {djangoisf => coolisf/rest}/migrations/__init__.py (100%) rename {djangoisf => coolisf/rest}/models.py (100%) rename {djangoisf => coolisf/rest}/tests.py (100%) rename {djangoisf => coolisf/rest}/urls.py (100%) rename {djangoisf => coolisf/rest}/views.py (100%) diff --git a/djangoisf/__init__.py b/coolisf/rest/__init__.py similarity index 100% rename from djangoisf/__init__.py rename to coolisf/rest/__init__.py diff --git a/djangoisf/admin.py b/coolisf/rest/admin.py similarity index 100% rename from djangoisf/admin.py rename to coolisf/rest/admin.py diff --git a/djangoisf/apps.py b/coolisf/rest/apps.py similarity index 100% rename from djangoisf/apps.py rename to coolisf/rest/apps.py diff --git a/djangoisf/migrations/__init__.py b/coolisf/rest/migrations/__init__.py similarity index 100% rename from djangoisf/migrations/__init__.py rename to coolisf/rest/migrations/__init__.py diff --git a/djangoisf/models.py b/coolisf/rest/models.py similarity index 100% rename from djangoisf/models.py rename to coolisf/rest/models.py diff --git a/djangoisf/tests.py b/coolisf/rest/tests.py similarity index 100% rename from djangoisf/tests.py rename to coolisf/rest/tests.py diff --git a/djangoisf/urls.py b/coolisf/rest/urls.py similarity index 100% rename from djangoisf/urls.py rename to coolisf/rest/urls.py diff --git a/djangoisf/views.py b/coolisf/rest/views.py similarity index 100% rename from djangoisf/views.py rename to coolisf/rest/views.py diff --git a/djangoisfsite/settings.py b/djangoisfsite/settings.py index c2a200b..908962e 100644 --- a/djangoisfsite/settings.py +++ b/djangoisfsite/settings.py @@ -20,7 +20,7 @@ # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 's#ipnb2txrgilj$gb3#^-m1_n2+%*mgxjvuf&6i8b8dcngtg6e' +SECRET_KEY = 'replace-this-with-production-key' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True From 6eb3d3d713f2d65bd630ae37cfb00e9abe7e6df9 Mon Sep 17 00:00:00 2001 From: Le Tuan Anh Date: Sun, 9 May 2021 21:39:40 +0800 Subject: [PATCH 09/14] rename djangoisf to coolisf.rest --- coolisf/__main__.py | 4 +++ coolisf/rest/views.py | 61 ++++++++----------------------------------- 2 files changed, 15 insertions(+), 50 deletions(-) diff --git a/coolisf/__main__.py b/coolisf/__main__.py index 8433982..ec50d9b 100644 --- a/coolisf/__main__.py +++ b/coolisf/__main__.py @@ -1,2 +1,6 @@ +# This code is a part of coolisf library: https://github.com/letuananh/intsem.fx +# :copyright: (c) 2014 Le Tuan Anh +# :license: MIT, see LICENSE for more details. + from . import main main.main() diff --git a/coolisf/rest/views.py b/coolisf/rest/views.py index d40e77d..518c694 100644 --- a/coolisf/rest/views.py +++ b/coolisf/rest/views.py @@ -1,49 +1,13 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -''' -YAWOL-Django - Yet Another Wordnet Online (REST server) for Django -Latest version can be found at https://github.com/letuananh/yawlib - -References: - Python documentation: - https://docs.python.org/ - PEP 257 - Python Docstring Conventions: - https://www.python.org/dev/peps/pep-0257/ - -@author: Le Tuan Anh -''' - -# Copyright (c) 2017, Le Tuan Anh -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -__author__ = "Le Tuan Anh " -__copyright__ = "Copyright 2017, yawlib" -__credits__ = [] -__license__ = "MIT" -__version__ = "0.1" -__maintainer__ = "Le Tuan Anh" -__email__ = "" -__status__ = "Prototype" - -######################################################################## +""" +coolisf REST API for Django site +""" + +# This code is a part of coolisf library: https://github.com/letuananh/intsem.fx +# :copyright: (c) 2014 Le Tuan Anh +# :license: MIT, see LICENSE for more details. import json import logging @@ -59,8 +23,6 @@ # CONFIGURATION # --------------------------------------------------------------------- -logger = logging.getLogger(__name__) -logger.setLevel(logging.INFO) RESULTS = (1, 5, 10, 20, 30, 40, 50, 100, 500) TAGGERS = {ttl.Tag.LELESK: "LeLesk", ttl.Tag.MFS: "MFS", ttl.Tag.DEFAULT: "None"} ghub = GrammarHub() @@ -131,16 +93,15 @@ def parse(request): raise Http404('Unknown grammar') # Parse sentence - logger.info("Parsing sentence: ... " + sentence_text) + logging.getLogger(__name__).info("Parsing sentence: ... " + sentence_text) sent = ghub.parse_json(sentence_text, grammar, parse_count, tagger) - logger.debug("Shallow: {}".format(sent['shallow'])) - logger.debug("Parses: {}".format(len(sent))) - logger.info("Done parsing") + logging.getLogger(__name__).debug("Shallow: {}".format(sent['shallow'])) + logging.getLogger(__name__).debug("Parses: {}".format(len(sent))) + logging.getLogger(__name__).info("Done parsing") return sent @jsonp def version(request): return {'product': 'djangoisf', - 'version': __version__, 'server': 'coolisf-{}/Django-{}'.format(coolisf.__version__, django.get_version())} From 8ee7ac089b279c37d99c48a1673b9cf7239fcc91 Mon Sep 17 00:00:00 2001 From: Le Tuan Anh Date: Sun, 9 May 2021 21:46:35 +0800 Subject: [PATCH 10/14] fix djangoisfsite --- coolisf/rest/views.py | 2 +- djangoisfsite/urls.py | 2 +- requirements-web.txt | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 requirements-web.txt diff --git a/coolisf/rest/views.py b/coolisf/rest/views.py index 518c694..112d0b9 100644 --- a/coolisf/rest/views.py +++ b/coolisf/rest/views.py @@ -14,7 +14,7 @@ import django from django.http import HttpResponse, Http404 -from chirptext import texttaglib as ttl +from texttaglib.chirptext import ttl import coolisf from coolisf import GrammarHub from coolisf.model import Reading diff --git a/djangoisfsite/urls.py b/djangoisfsite/urls.py index c25faba..c8d420a 100644 --- a/djangoisfsite/urls.py +++ b/djangoisfsite/urls.py @@ -17,6 +17,6 @@ from django.contrib import admin urlpatterns = [ - url(r'^restisf/', include('djangoisf.urls')), + url(r'^restisf/', include('coolisf.rest.urls')), url(r'^admin/', admin.site.urls), ] diff --git a/requirements-web.txt b/requirements-web.txt new file mode 100644 index 0000000..fe7d563 --- /dev/null +++ b/requirements-web.txt @@ -0,0 +1 @@ +django<2.0 From 3fc44a69aca517e8e55dd8ec1055834f5a438ad6 Mon Sep 17 00:00:00 2001 From: Le Tuan Anh Date: Sun, 9 May 2021 22:45:58 +0800 Subject: [PATCH 11/14] Update README.md --- README.md | 103 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 53 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index 905c360..09eac95 100644 --- a/README.md +++ b/README.md @@ -1,77 +1,80 @@ -Integrated Semantic Framework (intsem.fx) -========= +# Integrated Semantic Framework (intsem.fx) -# Prerequisite +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. -* Python >= 3.5 -* Required packages (see requirements.txt) -* English Resource Grammar (rev >= 26135) -* NLTK data -* LeLESK data (see https://github.com/letuananh/lelesk) +# Install -# Installation +`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 -* Download and install ACE >= 0.9.26 from: http://sweaglesw.org/linguistics/ace/ -* Download ERG trunk from SVN `svn checkout http://svn.delph-in.net/erg/trunk` -* Build erg.dat `ace -g ace/config.tdl -G erg.dat` -* Download the latest release from: https://github.com/letuananh/intsem.fx/releases, unzip it to a folder and run the `isf` command -* Download NLTK data ``` -import nltk -nltk.download("book") +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 -Tips: -`pip` is recommended for installing required packages -``` -python -m pip install -r requirements.txt +```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/` -# Using ISF +The final data folder should look something like this ``` -cd ~/workspace/intsem.fx -./isf parse data/sample.txt data/sample.out +/home/user/local/isf/data +├── grammars +│   ├── erg.dat +│   └── jacy.dat +├── lexrules.db ``` -# Development +# Using ISF -WARNING: These are meant for developers who want to contribute to the codebase. If all you need is to run the ISF to process your data, please see the Installation section above instead. +To parse a sentence, use coolisf `text` command -2 - Check out the code of intsem.fx to ~/workspace with: +```bash +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] +... ``` -git clone --recursive https://github.com/letuananh/intsem.fx.git -``` - -3 - Check out ERG to your workspace folder and compile the grammar -This is complicated, read more here: http://moin.delph-in.net/TuanAnhLe/GramEng4Dummies +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` -Basically, I need the grammar file (erg.dat) to be located at ~/workspace/cldata/erg.dat - -4 - Configure the application -``` -cd ~/workspace/intsem.fx -./config.sh -``` -To use ISF, please try ``` -cd ~/workspace/intsem.fx -./isf --help +I drink green tea. +Sherlock Holmes has three guard dogs. +A soul is not a living thing. +Do you have any green tea chest? ``` -Notes: +After that, run the following command and the output will be written to the file `demo_out.xml` -Use virtualenv to install required packages -``` -python3 -m venv ~/isf_py3 -. ~/isf_py3/bin/activate +```bash +python -m coolisf parse demo.txt -o demo_out.xml ``` -Install these packages if you are using Fedora Linux: -``` -sudo dnf install -y redhat-rpm-config gcc-c++ -``` +If you encounter any issue, please submit an issue at: https://github.com/letuananh/intsem.fx/issues From d7a1eb4818c531419885a4cc1d96795d4f24bc79 Mon Sep 17 00:00:00 2001 From: Le Tuan Anh Date: Sun, 9 May 2021 22:47:09 +0800 Subject: [PATCH 12/14] update version info --- coolisf/__version__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/coolisf/__version__.py b/coolisf/__version__.py index 3ec4ff4..47b8308 100644 --- a/coolisf/__version__.py +++ b/coolisf/__version__.py @@ -9,11 +9,11 @@ __copyright__ = "Copyright (c) 2014, Le Tuan Anh " __credits__ = [] __license__ = "MIT License" -__description__ = "a Python package for providing computational deep semantic analysis by combining structural semantics from construction grammars and ontology-based lexical semantics in a single representation" +__description__ = "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." __url__ = "https://github.com/letuananh/intsem.fx/" __issue__ = "https://github.com/letuananh/intsem.fx/" __maintainer__ = "Le Tuan Anh" __version_major__ = "0.2.3" # follow PEP-0440 -__version__ = "{}beta".format(__version_major__) -__version_long__ = "{} - Beta".format(__version_major__) +__version__ = "{}b1".format(__version_major__) +__version_long__ = "{} - Beta 1".format(__version_major__) __status__ = "4 - Beta" From 4cdb842de3da2ca03f0d8c3ae07307babf664e7d Mon Sep 17 00:00:00 2001 From: Le Tuan Anh Date: Sun, 9 May 2021 22:47:15 +0800 Subject: [PATCH 13/14] update setup script --- setup.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/setup.py b/setup.py index 3b15dbc..9e0d547 100755 --- a/setup.py +++ b/setup.py @@ -3,13 +3,11 @@ ''' Setup script for Integrated Semantic Framework. -Latest version can be found at https://github.com/letuananh/intsem.fx - -@author: Le Tuan Anh -@license: MIT ''' -######################################################################## +# This code is a part of coolisf library: https://github.com/letuananh/intsem.fx +# :copyright: (c) 2014 Le Tuan Anh +# :license: MIT, see LICENSE for more details. import io import os @@ -33,6 +31,9 @@ def read(*filenames, **kwargs): pkg_info = {} exec(read('coolisf/__version__.py'), pkg_info) +with open('requirements.txt', 'r') as infile: + requirements = infile.read().splitlines() + setup( name='coolisf', version=pkg_info["__version__"], @@ -40,15 +41,18 @@ def read(*filenames, **kwargs): license=pkg_info["__license__"], author=pkg_info["__author__"], tests_require=[], - install_requires=[], + install_requires=requirements, + python_requires=">=3.6", author_email=pkg_info["__email__"], description=pkg_info["__description__"], long_description=long_description, packages=['coolisf', - 'coolisf/dao', - 'coolisf/mappings', - 'coolisf/parsers', - 'coolisf/processors'], + 'coolisf.dao', + 'coolisf.data', + 'coolisf.mappings', + 'coolisf.parsers', + 'coolisf.rest', + 'coolisf.processors'], include_package_data=True, platforms='any', test_suite='test', From d02edf5d325762f8aadc78aca7fc8d22c02b2994 Mon Sep 17 00:00:00 2001 From: Le Tuan Anh Date: Sun, 9 May 2021 22:47:20 +0800 Subject: [PATCH 14/14] include package data files --- MANIFEST.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MANIFEST.in b/MANIFEST.in index 6c36e39..1f3f672 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,5 @@ include README.md include LICENSE include requirements*.txt +include coolisf/dao/scripts/*.sql +include coolisf/data/*.gz