Commit faaf2b28 authored by Javi Corvi's avatar Javi Corvi
Browse files

is treatment related improvement

parent 37e6a5b2
Pipeline #26145 passed with stage
in 1 minute and 47 seconds
......@@ -215,19 +215,26 @@ public class App {
sentence.getFeatures().put("ANNOTATION_TYPE", "RELEVANT_TEXT");
doc.getAnnotations(annotationSetRelationExtraction).add(sentence.getStartNode(), sentence.getEndNode(), "FINDING_"+finding_id, sentence.getFeatures());
//verify if is treatment related or not
Annotation ann = isTreatmentRelatedFinding(doc, finding, sentenceFields);
if(ann!=null) {
System.out.println("TREATMENT_RELATED: " + gate.Utils.stringFor(doc, ann));
ann.getFeatures().put("ANNOTATION_TYPE", "IS_TREATMENT_RELATED");
doc.getAnnotations(annotationSetRelationExtraction).add(ann.getStartNode(), ann.getEndNode(), "FINDING_"+finding_id, ann.getFeatures());
}else {
FeatureMap features_uncertain = Factory.newFeatureMap();
features_uncertain.put(template_value_name, "Y");
features_uncertain.put("ANNOTATION_TYPE", "IS_TREATMENT_RELATED");
doc.getAnnotations(annotationSetRelationExtraction).add(sentence.getStartNode(), sentence.getEndNode(), "FINDING_"+finding_id, features_uncertain);
if(finding.getFeatures().get("IS_TREATMENT_RELATED")!=null) {
Annotation is_treatment_related = as.get(new Integer(finding.getFeatures().get("IS_TREATMENT_RELATED").toString()));
is_treatment_related.getFeatures().put("ANNOTATION_TYPE", "IS_TREATMENT_RELATED");
doc.getAnnotations(annotationSetRelationExtraction).add(is_treatment_related.getStartNode(), is_treatment_related.getEndNode(), "FINDING_"+finding_id, is_treatment_related.getFeatures());
}
//verify if is treatment related or not
// Annotation ann = isTreatmentRelatedFinding(doc, finding, sentenceFields);
//
// if(ann!=null) {
// System.out.println("TREATMENT_RELATED: " + gate.Utils.stringFor(doc, ann));
// ann.getFeatures().put("ANNOTATION_TYPE", "IS_TREATMENT_RELATED");
// doc.getAnnotations(annotationSetRelationExtraction).add(ann.getStartNode(), ann.getEndNode(), "FINDING_"+finding_id, ann.getFeatures());
// }else {
// FeatureMap features_uncertain = Factory.newFeatureMap();
// features_uncertain.put(template_value_name, "Y");
// features_uncertain.put("ANNOTATION_TYPE", "IS_TREATMENT_RELATED");
// doc.getAnnotations(annotationSetRelationExtraction).add(sentence.getStartNode(), sentence.getEndNode(), "FINDING_"+finding_id, features_uncertain);
// }
if(finding.getType().equals("FINDING")) {
//TODO REVISAR SI ES NECESARIO UN MANIFESTATION OF FINDING
Annotation manifestation_finding = getClosestAnnotation(doc, sentenceFields, finding, "MANIFESTATION_FINDING", 10, 5, ";" );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment