Skip to content

Commit

Permalink
fix non-toplevel imports
Browse files Browse the repository at this point in the history
  • Loading branch information
LoicGrobol committed Mar 4, 2020
1 parent c26e9d3 commit edbac01
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions uuparser/arc_hybrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class ArcHybridLSTM:
def __init__(self, vocab, options):

# import here so we don't load Dynet if just running parser.py --help for example
from multilayer_perceptron import MLP
from feature_extractor import FeatureExtractor
from .multilayer_perceptron import MLP
from .feature_extractor import FeatureExtractor
import dynet as dy
global dy

Expand Down
4 changes: 2 additions & 2 deletions uuparser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

def run(experiment,options):
if options.graph_based:
from mstlstm import MSTParserLSTM as Parser
from .mstlstm import MSTParserLSTM as Parser
print('Working with a graph-based parser')
else:
from arc_hybrid import ArcHybridLSTM as Parser
from .arc_hybrid import ArcHybridLSTM as Parser
print('Working with a transition-based parser')

if not options.predict: # training
Expand Down
4 changes: 2 additions & 2 deletions uuparser/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,9 @@ def evaluate(gold,test,conllu):
print("Writing to " + scoresfile)
if not conllu:
#os.system('perl src/utils/eval.pl -g ' + gold + ' -s ' + test + ' > ' + scoresfile + ' &')
os.system(f'perl {UTILS_DIR}/eval.pl -g {gold} -s {test} > {scoresfile}')
os.system(f'perl {UTILS_PATH}/eval.pl -g {gold} -s {test} > {scoresfile}')
else:
os.system(f'python {UTILS_DIR}/evaluation_script/conll17_ud_eval.py -v -w {UTILS_DIR}/evaluation_script/weights.clas {gold} {test} > {scoresfile}')
os.system(f'python {UTILS_PATH}/evaluation_script/conll17_ud_eval.py -v -w {UTILS_PATH}/evaluation_script/weights.clas {gold} {test} > {scoresfile}')
score = get_LAS_score(scoresfile,conllu)
return score

Expand Down

0 comments on commit edbac01

Please sign in to comment.