Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Stop Word list independant from the installation directory #13

Closed
espoirMur opened this issue May 19, 2021 · 0 comments · Fixed by #14
Closed

Make Stop Word list independant from the installation directory #13

espoirMur opened this issue May 19, 2021 · 0 comments · Fixed by #14

Comments

@espoirMur
Copy link
Contributor

  • OCTIS version: '1.5.0'
  • Python version: 3.7
  • Operating System: Mac

Description

I am trying to preprocess some custom corpus and When I am trying to remove stop word here is what I get.

What I Did

preprocessor = Preprocessing(vocabulary=None, max_features=None, 
                             remove_punctuation=True, punctuation=string.punctuation,
                             lemmatize=True, stopword_list='english',
                             min_chars=1, min_words_docs=0)
# preprocess
dataset = preprocessor.preprocess_dataset(documents_path=corpus_path)

And I am getting the following error.

ndexes)
    101             else:
    102                 if 'english' in stopword_list:
--> 103                     with open('octis/preprocessing/stopwords/english.txt') as fr:
    104                         stopwords = [line.strip() for line in fr.readlines()]
    105                         assert stopword_list == language

FileNotFoundError: [Errno 2] No such file or directory: 'octis/preprocessing/stopwords/english.txt'

More context I am using jupyter notebook.

A possible solution.. it may be useful to use pathlib to handle those type of path.

If I fix it locally I can raise a PR soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant