Skip to content

Commit

Permalink
fixed dependencies -> new release
Browse files Browse the repository at this point in the history
  • Loading branch information
Hämäläinen, Mika K committed Feb 20, 2020
1 parent 25785e6 commit 2d0cb59
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ This library will have methods for processing historical English corpora, especi

Note: It is highly recommended to use a virtual environment because of the strict version requirements for dependencies. The library has been tested with Python 3.6

pip3 --no-cache-dir install pip==18.1
pip3 install natas --process-dependency-links
pip3 install natas
python3 -m natas.download
python3 -m spacy download en_core_web_md

Expand Down
4 changes: 4 additions & 0 deletions natas/download.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
from mikatools import *
import os

def main():
url = "https://github.com/mikahama/natas/raw/master/natas/models/"
models = ["normalization_brnn_latech19.pt", "normalization.pt", "ocr_ranlp19.pt", "ocr.pt"]
model_path = script_path("models")
if not os.path.exists(model_path):
os.mkdir(model_path)
for i, model in enumerate(models):
print("Downloading", i+1, "out of", len(models) )
download_file(url + model, script_path("models/" + model), show_progress=True)
Expand Down
7 changes: 5 additions & 2 deletions natas/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
import spacy
import os


wiktionary = set([x.lower() for x in json_load(script_path("wiktionary_lemmas.json"))])
try:
wiktionary = set([x.lower() for x in json_load(script_path("wiktionary_lemmas.json"))])
except:
print("run python -m natas.download")
wiktionary = []

is_in_data_cache = {"ceec_eng":{}, "ocr_fin":{}}

Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='1.0.4',
version='1.0.5',

description='Python library for processing historical English',
long_description=long_description,
Expand Down Expand Up @@ -69,8 +69,7 @@
# your project is installed. For an analysis of "install_requires" vs pip's
# requirements files see:
# https://packaging.python.org/en/latest/requirements.html
install_requires=["configargparse","distance", "torch==1.0.0", "torchtext>=0.4.0@https://mikakalevi.com/downloads/text-master.zip#egg=torchtext-0.4.0", "spacy>=2.1.4", "mikatools>=0.0.6",r"OpenNMT-py>=0.8.2@https://github.com/OpenNMT/OpenNMT-py/archive/0.8.2.zip#egg=OpenNMT-py-0.8.2"],
dependency_links=["https://mikakalevi.com/downloads/text-master.zip#egg=torchtext-0.4.0","https://github.com/OpenNMT/OpenNMT-py/archive/0.8.2.zip#egg=OpenNMT-py-0.8.2"],
install_requires=["configargparse","distance", "spacy>=2.1.4", "mikatools>=0.0.6","OpenNMT-py>=0.8.2"],
# List additional groups of dependencies here (e.g. development
# dependencies). You can install these using the following syntax,
# for example:
Expand Down

0 comments on commit 2d0cb59

Please sign in to comment.