Skip to content
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
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@ Additionally, `pip install -r optrequirements.txt` for optional dependencies use

## Building

`python run_mindep.py run lang1 lang2 ... langn` for an initial run.
```
python run_mindep.py run lang1 lang2 ... langn > out.csv
python run_mindep.py postprocess out.csv > processed.csv
```

The list of langs can be found at `corpora.ud_langs`.
Empty file added mindep/__init__.py
Empty file.
File renamed without changes.
2 changes: 1 addition & 1 deletion opt_mindep.py → mindep/opt_mindep.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from rfutils import mreduce_by_key

import conditioning as cond
import mindep
from . import mindep

WEIGHT_MIN = -1
WEIGHT_MAX = 1
Expand Down
6 changes: 3 additions & 3 deletions run_mindep.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import division
import sys
import copy
import itertools
import functools
import random
import csv
Expand All @@ -10,8 +9,8 @@
import pandas as pd
#from distributed import Executor, as_completed

import mindep
import opt_mindep
from mindep import mindep
from mindep import opt_mindep
#import linearize as lin
import corpora

Expand All @@ -32,6 +31,7 @@ def with_open(filename, mode, f):

@rfutils.memoize
def load_linearization_model(lang, spec):
import pickle
return with_open(MODEL_FILENAME_TEMPLATE % (lang, spec), 'rb', pickle.load)

LANGS = set(corpora.ud_corpora.keys())
Expand Down