Skip to content
Snippets Groups Projects
Commit c5754298 authored by Franck Dary's avatar Franck Dary
Browse files

Il oracle costs, count arc root

parent 61e4dc79
No related branches found
No related tags found
No related merge requests found
...@@ -175,7 +175,7 @@ def scoreOracleRight(config, ml, size, label) : ...@@ -175,7 +175,7 @@ def scoreOracleRight(config, ml, size, label) :
def scoreOracleLeft(config, ml, size, label) : def scoreOracleLeft(config, ml, size, label) :
correct = 1 if config.getGold(config.stack[-size], "HEAD") == config.wordIndex else 0 correct = 1 if config.getGold(config.stack[-size], "HEAD") == config.wordIndex else 0
labelErr = 0 if label is None else (0 if config.getGold(config.stack[-size], "DEPREL") == label else 1) labelErr = 0 if label is None else (0 if config.getGold(config.stack[-size], "DEPREL") == label else 1)
return sum([ml["StackRight"+str(n)] for n in range(1,size+1)]) - correct + labelErr return sum([ml["StackRight"+str(n)] for n in range(1,size+1)]) - correct + labelErr + (1 if config.getGold(config.stack[-size], "HEAD") == 0 else 0)
################################################################################ ################################################################################
################################################################################ ################################################################################
...@@ -185,7 +185,7 @@ def scoreOracleShift(config, ml) : ...@@ -185,7 +185,7 @@ def scoreOracleShift(config, ml) :
################################################################################ ################################################################################
def scoreOracleReduce(config, ml) : def scoreOracleReduce(config, ml) :
return ml["StackRight1"] return ml["StackRight1"] + (1 if config.getGold(config.stack[0], "HEAD") == 0 else 0)
################################################################################ ################################################################################
################################################################################ ################################################################################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment