nicolay-r / ARElight

Granular Viewer of Sentiments Between Entities in Massively Large Documents and Collections of Texts, powered by AREkit
https://link.springer.com/chapter/10.1007/978-3-031-56069-9_23
MIT License
37 stars 2 forks source link

Target node in radial nodes check #123

Closed nicolay-r closed 1 year ago

nicolay-r commented 1 year ago

Original script

python3 -m arelight.run.infer      --sampling-framework "arekit"     \
--ner-model-name "ner_ontonotes_bert"     --ner-types "ORG|PERSON|LOC|GPE"   \
--terms-per-context 50     --sentence-parser "nltk_en"     --tokens-per-context 128     \
--bert-framework "opennre"     --batch-size 10     --pretrained-bert "bert-base-cased"  \
--bert-torch-checkpoint "ra4-rsr1_bert-base-cased_cls.pth.tar"     --backend "d3js_graphs"  \
--host 8000     --docs-limit 500     -o "output"     \
--from-files ~/Desktop/TwExportly_BorisJohnson_tweets_2023_10_11.csv

Or shorter version (launch once you have all the necessary data):

python3 -m arelight.run.infer   --backend "d3js_graphs"     --host 8000  \
--docs-limit 500     -o "output"   \
--from-files ~/Desktop/TwExportly_BorisJohnson_tweets_2023_10_11.csv

Raises exception:

radial_graph = graph_to_radial(graph) if convert_to_radial else graph
  File "/home/nicolay/proj/ARElight/arelight/backend/d3js/utils_graph.py", line 30, in graph_to_radial
    radial_nodes[target_node]["imports"].append({
KeyError: 'ORG.the North Atlantic Alliance'