leolani / cltl-chatbots

Series of chatbots that demonstrate Leolani’s functionalities
Apache License 2.0
0 stars 1 forks source link

Notebook - FileNotFoundError: lexicon.json #9

Closed Tomaati closed 2 years ago

Tomaati commented 2 years ago

Dear all,

I am trying to get the notebooks running to get a better understanding of how everything works, but whenever I run some of the notebooks I run into issues with a file that does not exist:

FileNotFoundError                         Traceback (most recent call last)
/tmp/ipykernel_108237/3505524354.py in <module>
     18 from cltl.reply_generation.data.sentences import GREETING, ASK_NAME, ELOQUENCE, TALK_TO_ME
     19 from cltl.reply_generation.lenka_replier import LenkaReplier
---> 20 from cltl.triple_extraction.api import Chat, UtteranceHypothesis
     21 from emissor.persistence import ScenarioStorage
     22 from emissor.representation.annotation import AnnotationType, Token, NER

~/Documents/University/cltl-chatbots/old_env/lib/python3.7/site-packages/cltl/triple_extraction/api.py in <module>
     13 from cltl.combot.backend.api.discrete import UtteranceType
     14 from cltl.combot.backend.utils.casefolding import casefold_text
---> 15 from cltl.triple_extraction.analyzer import Analyzer
     16 from cltl.triple_extraction.data.base_cases import friends
     17 from cltl.triple_extraction.ner import NER

~/Documents/University/cltl-chatbots/old_env/lib/python3.7/site-packages/cltl/triple_extraction/analyzer.py in <module>
      2 
      3 from cltl.triple_extraction.ner import NER
----> 4 from cltl.triple_extraction.utils.helper_functions import *
      5 
      6 

~/Documents/University/cltl-chatbots/old_env/lib/python3.7/site-packages/cltl/triple_extraction/utils/helper_functions.py in <module>
     17 
     18 ROOT = os.path.join(os.path.dirname(__file__), '..')
---> 19 lexicon = json.load(open(os.path.join(ROOT, 'data', 'lexicon.json')))
     20 
     21 

FileNotFoundError: [Errno 2] No such file or directory: '/home/tom/Documents/University/cltl-chatbots/old_env/lib/python3.7/site-packages/cltl/triple_extraction/utils/../data/lexicon.json'

I am running Manjaro Linux with Python 3.7.13. Did I mess something up or am I forgetting something?

Thanks in advance!

numblr commented 2 years ago

Hi,

apparently the non-python files from here: https://github.com/leolani/cltl-knowledgeextraction/tree/main/src/cltl/triple_extraction/data are missing from the cltl.triple-extraction 0.0.dev6 package. I will take a look at it, until I get to fix it you can try to copy those files by hand into to the location in the virtual environment mentioned in the error. It's also possible that more files are missing from the package.

Tomaati commented 2 years ago

Thank you for the quick fix!

piekvossen commented 2 years ago

Also cfg.txt is not copied and needs to be added manually in the folder triple_extraction/data

piekvossen commented 2 years ago

Dear Tom,

The json files do not get included in the pip packages. Please get them from the source repos and copy them in the right locations.

Piek

Sent from my iPad

On 19 Mar 2022, at 18:41, Tom Saveur @.***> wrote:



Dear all,

I am trying to get the notebooks running to get a better understanding of how everything works, but whenever I run some of the notebooks I run into issues with a file that does not exist:

FileNotFoundError Traceback (most recent call last) /tmp/ipykernel_108237/3505524354.py in 18 from cltl.reply_generation.data.sentences import GREETING, ASK_NAME, ELOQUENCE, TALK_TO_ME 19 from cltl.reply_generation.lenka_replier import LenkaReplier ---> 20 from cltl.triple_extraction.api import Chat, UtteranceHypothesis 21 from emissor.persistence import ScenarioStorage 22 from emissor.representation.annotation import AnnotationType, Token, NER

~/Documents/University/cltl-chatbots/old_env/lib/python3.7/site-packages/cltl/triple_extraction/api.py in 13 from cltl.combot.backend.api.discrete import UtteranceType 14 from cltl.combot.backend.utils.casefolding import casefold_text ---> 15 from cltl.triple_extraction.analyzer import Analyzer 16 from cltl.triple_extraction.data.base_cases import friends 17 from cltl.triple_extraction.ner import NER

~/Documents/University/cltl-chatbots/old_env/lib/python3.7/site-packages/cltl/triple_extraction/analyzer.py in 2 3 from cltl.triple_extraction.ner import NER ----> 4 from cltl.triple_extraction.utils.helper_functions import * 5 6

~/Documents/University/cltl-chatbots/old_env/lib/python3.7/site-packages/cltl/triple_extraction/utils/helper_functions.py in 17 18 ROOT = os.path.join(os.path.dirname(file), '..') ---> 19 lexicon = json.load(open(os.path.join(ROOT, 'data', 'lexicon.json'))) 20 21

FileNotFoundError: [Errno 2] No such file or directory: '/home/tom/Documents/University/cltl-chatbots/old_env/lib/python3.7/site-packages/cltl/triple_extraction/utils/../data/lexicon.json'

I am running Manjaro Linux with Python 3.7.13. Did I mess something up or am I forgetting something?

Thanks in advance!

— Reply to this email directly, view it on GitHubhttps://github.com/leolani/cltl-chatbots/issues/9, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAUDKLFDCWX4YHHINBTUNCDVAYGUVANCNFSM5REJPDDQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>