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-terminology-annotation
Commits
421fe8bb
Commit
421fe8bb
authored
Apr 01, 2022
by
Javi Corvi
Browse files
more improvement in study and specimen
parent
13abb018
Pipeline
#28700
failed with stage
in 0 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
dictionaries/postprocessing-and-lexical-rules-matching/stop_words_finding_hpath.lst
View file @
421fe8bb
...
...
@@ -9,7 +9,6 @@ treatment-related
treatment related
alteration
unilateral
basophilic tubules
mature
lymphoid tissue
bile
...
...
jape_rules/main.jape
View file @
421fe8bb
...
...
@@ -50,6 +50,7 @@ relation-extraction/finding_group
relation-extraction/finding_dose
relation-extraction/finding_closest_sex
relation-extraction/finding_specimen_advance
relation-extraction/studytestcd_specimen_advance
relation-extraction/finding_specimen
relation-extraction/finding_manifestation
relation-extraction/studytest_manifestation
...
...
jape_rules/postprocessing-and-lexical-rules-matching/remove_manifestation_findings_false_positive_no_finding.jape
View file @
421fe8bb
...
...
@@ -24,8 +24,8 @@ Rule: delete_rule
AnnotationSet sentenceFields = inputAS.get(sentence.getStartNode().getOffset(), sentence.getEndNode().getOffset());
AnnotationSet annotations_type = sentenceFields.get(types);
if(annotations_type==null || annotations_type.size()==0){
System.out.println("MANIFESTATION ALONE: " + stringFor(doc, manifestation));
System.out.println(stringFor(doc, sentence));
//
System.out.println("MANIFESTATION ALONE: " + stringFor(doc, manifestation));
//
System.out.println(stringFor(doc, sentence));
outputAS.remove(manifestation);
}
}
...
...
jape_rules/relation-extraction/finding_specimen_advance.jape
View file @
421fe8bb
...
...
@@ -23,11 +23,11 @@ Rule: finding_specimen_advance
gate.AnnotationSet specimen_entities = lookup.get("SPECIMEN");
gate.AnnotationSet man_entities = lookup.get("FINDING");
gate.Annotation finding_change = man_entities.iterator().next();
String content = stringFor(doc, lookup.firstNode().getOffset(),lookup.lastNode().getOffset());
//System.out.println("FINDING:" + stringFor(doc, finding_change));
//System.out.println(content);
gate.FeatureMap features = finding_change.getFeatures();
String content = stringFor(doc, lookup.firstNode().getOffset(),lookup.lastNode().getOffset());
features.put("text", stringFor(doc, finding_change));
features.put("text", stringFor(doc, finding_change));
features.put("rule", "FINDING_SPECIMEN");
Boolean first = true;
String spe_ids = "";
...
...
jape_rules/relation-extraction/studytestcd_specimen_advance.jape
0 → 100644
View file @
421fe8bb
//this rule annotates findings orientated to detect MANIFESTATION OF FINDING Changes in a specimen
Imports: {
import static gate.Utils.*;
}
Phase:secondphase
Input: Token STUDY_TESTCD SPECIMEN
Options: control = appelt
Rule: finding_specimen_advance
(
({SPECIMEN} {STUDY_TESTCD}) |
({STUDY_TESTCD} ({Token})[0,3] {Token.pos=="IN"} ({Token.pos=="DT"})? {SPECIMEN} (({Token.root==","} | {Token.root=="and"}) {SPECIMEN})[0,8])
) :finding_specimen_advance
-->
{
gate.AnnotationSet lookup = (gate.AnnotationSet) bindings.get("finding_specimen_advance");
gate.Annotation ann = (gate.Annotation) lookup.iterator().next();
gate.AnnotationSet sentence_set = outputAS.get("Sentence",ann.getStartNode().getOffset(), ann.getEndNode().getOffset());
gate.Annotation sentence = sentence_set.iterator().next();
//System.out.println("finding_specimen_advance");
//System.out.println(stringFor(doc, sentence));
try{
//System.out.println(doc.getName());
gate.AnnotationSet specimen_entities = lookup.get("SPECIMEN");
gate.AnnotationSet man_entities = lookup.get("STUDY_TESTCD");
gate.Annotation finding_change = man_entities.iterator().next();
String content = stringFor(doc, lookup.firstNode().getOffset(),lookup.lastNode().getOffset());
//System.out.println("FINDING:" + stringFor(doc, finding_change));
System.out.println(content);
gate.FeatureMap features = finding_change.getFeatures();
features.put("text", stringFor(doc, finding_change));
features.put("rule", "STUDY_TESTCD_SPECIMEN");
Boolean first = true;
String spe_ids = "";
for (Annotation spe : specimen_entities) {
//System.out.println("SPECIMEN:" + stringFor(doc, spe));
if(first){
spe_ids = spe.getId().toString();
first=false;
}else{
spe_ids = spe_ids+","+spe.getId().toString();
}
}
features.put("SPECIMEN", spe_ids);
//System.out.println(stringFor(doc, lookup.firstNode().getOffset(),lookup.lastNode().getOffset()));
//outputAS.add(finding_change.getStartNode().getOffset(),finding_change.getEndNode().getOffset(), "FINDING", features);
outputAS.add(lookup.firstNode().getOffset(),lookup.lastNode().getOffset(), "STUDY_TEST_2", features);
}catch(InvalidOffsetException e){
throw new LuckyException(e);
}
}
\ No newline at end of file
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