Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
INB
eTRANSAFE
pretox-relation-extraction
Commits
faaf2b28
Commit
faaf2b28
authored
Nov 25, 2021
by
Javi Corvi
Browse files
is treatment related improvement
parent
37e6a5b2
Pipeline
#26145
passed with stage
in 1 minute and 47 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/es/bsc/inb/ades/relation/extraction/main/App.java
View file @
faaf2b28
...
...
@@ -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
,
";"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment