File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 28
28
instances = run .generate_candidates (document .documentText )
29
29
for passage in document .passages :
30
30
annotated_properties = set (map (lambda x : x .propertyId , passage .exhaustivelyAnnotatedProperties ))
31
- if len (annotated_properties ) == 0 :
31
+ if which == "dev" and len (annotated_properties ) == 0 :
32
32
continue
33
33
passage_instances = list (filter (lambda x : x .is_in_span (passage .passageStart , passage .passageEnd ), instances ))
34
- run .classify_instances (passage_instances , annotated_properties )
34
+ if which == "dev" :
35
+ run .classify_instances (passage_instances , annotated_properties )
36
+ else :
37
+ run .classify_instances (passage_instances )
35
38
passage .facts = []
36
39
for fact in passage_instances :
37
40
for predicate_id , label in fact .labels .items ():
@@ -59,6 +62,7 @@ def print_evaluation(eval_type):
59
62
evals = evaluator .microEvaluation (confusionMatrix , True )
60
63
evals .extend (evaluator .macroEvaluation (confusionMatrix ))
61
64
65
+ evaluator .writeAnalysisFile (analysis , 'tmp' , eval_type )
62
66
evaluator .writeHtmlFile (analysis , 'tmp' , eval_type , goldProperties )
63
67
64
68
print_evaluation ("span_overlap" )
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ def generate_candidates(text):
122
122
123
123
return instances
124
124
125
- def classify_instances (instances , predicate_ids_to_classify , includeUri = True ):
125
+ def classify_instances (instances , predicate_ids_to_classify = predicate_thresholds . keys () , includeUri = True ):
126
126
if len (instances ) == 0 :
127
127
return
128
128
max_length = max ([ len (instance .get_words ()) for instance in instances ])
@@ -190,7 +190,7 @@ def run_batch(texts):
190
190
ret = []
191
191
for text in texts :
192
192
instances = generate_candidates (text )
193
- classify_instances (instances , predicate_thresholds . keys () )
193
+ classify_instances (instances )
194
194
ret .append (instances )
195
195
return ret
196
196
You can’t perform that action at this time.
0 commit comments