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

Modify notebooks and fix installation erros #1

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nlaugmenter/utils/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def initialize_models():
global glove

# load spacy
spacy_nlp = spacy.load("en_core_web_sm")
spacy_nlp = spacy.load("en_core_web_sm", disable=["lemmatizer"]) # disabling the warnings for lemmatizer seen during CI/CD and installation

# load glove
glove = vocab.GloVe(name="6B", dim="100")
Expand Down
9 changes: 9 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os

from setuptools import find_packages, setup
from setuptools.command.install import install as _install

from nlaugmenter import __version__
from nlaugmenter.evaluation.TestRunner import OperationRuns
Expand Down Expand Up @@ -142,6 +143,13 @@ def get_extra_requirements() -> dict:
requirements[entry] = filter_requirements(req_string)
return requirements

# This is a hack for the nltk lookup error for omw-1.4
class NLTKDownload(install):
def run(self):
self.do_egg_install()
import nltk
# Download the missing corpora
nltk.download('omw-1.4')

setup(
name=NAME,
Expand Down Expand Up @@ -183,4 +191,5 @@ def get_extra_requirements() -> dict:
},
include_package_data=True,
python_requires=">=3.7",
cmdclass={'download_nltk': NLTKDownload}
)