Skip to content

Commit

Permalink
Move the Turku data out of the checkout directory
Browse files Browse the repository at this point in the history
  • Loading branch information
aajanki committed Apr 3, 2022
1 parent d2d5256 commit 223d5c5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
data/
models/models_fi_tdt_dia/
models/stanza_resources/
models/trankit_resources/
results/
Expand Down
2 changes: 1 addition & 1 deletion install_turku_pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ set -eu

echo "Downloading the Finnish Turku pipeline model"
cd models/Turku-neural-parser-pipeline
python3 fetch_models.py fi_tdt_dia
python3 fetch_models.py --to .. fi_tdt_dia
8 changes: 4 additions & 4 deletions nlpmodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ def split_sentences(self, response):

def _process_sentences(self, texts):
command = [
'python', 'tnpp_parse.py',
'--conf', 'models_fi_tdt_dia/pipelines.yaml',
'python', 'models/Turku-neural-parser-pipeline/tnpp_parse.py',
'--conf', 'models/models_fi_tdt_dia/pipelines.yaml',
'parse_plaintext'
]
p = subprocess.run(command, cwd='models/Turku-neural-parser-pipeline',
input='\n\n'.join(texts), capture_output=True, text=True)
p = subprocess.run(command, input='\n\n'.join(texts),
capture_output=True, text=True)
if p.returncode != 0:
print(f'Turku pipeline failed with return code {p.returncode}')
print(p.stderr)
Expand Down

0 comments on commit 223d5c5

Please sign in to comment.