Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporate remote clinical pipeline and stave #793

Closed
wants to merge 27 commits into from

Conversation

Piyush13y
Copy link
Collaborator

This PR fixes #745.

Description of changes

We provide a remote service pipeline that handles interaction between the chatbot and the elastic search indexer, to get the results visualized through stave on the UI.
We also create 2 stave projects in the script, one for annotation viewing and the other to act as the search engine/chat bot.

@codecov
Copy link

codecov bot commented May 20, 2022

Codecov Report

Merging #793 (c9aa59f) into master (8e03abe) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #793   +/-   ##
=======================================
  Coverage   80.75%   80.75%           
=======================================
  Files         254      254           
  Lines       19364    19364           
=======================================
  Hits        15637    15637           
  Misses       3727     3727           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e03abe...c9aa59f. Read the comment docs.

@Piyush13y Piyush13y marked this pull request as ready for review June 13, 2022 04:57
Copy link
Member

@hunterhector hunterhector left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • An explanation of what is happening here would be very helpful, basically how the data flows.
  • Will the chat_project_old file be removed?

@@ -0,0 +1,3 @@
{
"index.mapping.coerce": false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this file used here? Couldn't find a reference in code.

Btw, this file is also quite small, if it is used in code, maybe using it directly in the code is easier (for example purposes)

{
"name": "query_chatbot.json",
"project_id": 99,
"textPack": "{\n \"py/object\": \"forte.data.data_pack.DataPack\",\n \"py/state\": {\n \"creation_records\": {},\n \"field_records\": {},\n \"links\": [],\n \"groups\": [],\n \"meta\": {\n \"py/object\": \"forte.data.data_pack.Meta\",\n \"py/state\": {\n \"pack_name\": \"query_chatbot\",\n \"_pack_id\": 3,\n \"language\": \"eng\",\n \"span_unit\": \"character\"\n }\n },\n \"_text\": \"Welcome! Please type in a query to retrieve relevant clinical reports.\",\n \"annotations\": [\n {\n \"py/object\": \"ft.onto.base_ontology.Utterance\",\n \"py/state\": {\n \"_span\": {\n \"py/object\": \"forte.data.span.Span\",\n \"begin\": 0,\n \"end\": 70\n },\n \"_tid\": 0,\n \"speaker\": \"ai\"\n }\n }\n ],\n \"generics\": [],\n \"replace_back_operations\": [],\n \"processed_original_spans\": [],\n \"orig_text_len\": 70,\n \"serialization\": {\n \"next_id\": 1\n }\n }\n}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These files don't look like JSON to me, there are these \ escapes here and there. I guess these are serialized in the wrong way.

{
"name": "clinical_pipeline_base",
"project_type": "single_pack",
"ontology": "{\n \"name\": \"base_ontology\",\n \"definitions\": [\n {\n \"entry_name\": \"ft.onto.base_ontology.Token\",\n \"parent_entry\": \"forte.data.ontology.top.Annotation\",\n \"description\": \"A span based annotation :class:`Token`, used to represent a token or a word.\",\n \"attributes\": [\n {\n \"name\": \"pos\",\n \"type\": \"str\"\n },\n {\n \"name\": \"ud_xpos\",\n \"type\": \"str\",\n \"description\": \"Language specific pos tag. Used in CoNLL-U Format. Refer to https://universaldependencies.org/format.html\"\n },\n {\n \"name\": \"lemma\",\n \"type\": \"str\",\n \"description\": \"Lemma or stem of word form.\"\n },\n {\n \"name\": \"chunk\",\n \"type\": \"str\"\n },\n {\n \"name\": \"ner\",\n \"type\": \"str\"\n },\n {\n \"name\": \"sense\",\n \"type\": \"str\"\n },\n {\n \"name\": \"is_root\",\n \"type\": \"bool\"\n },\n {\n \"name\": \"ud_features\",\n \"type\": \"Dict\",\n \"key_type\": \"str\",\n \"value_type\": \"str\"\n },\n {\n \"name\": \"ud_misc\",\n \"type\": \"Dict\",\n \"key_type\": \"str\",\n \"value_type\": \"str\"\n }\n ]\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.Subword\",\n \"parent_entry\": \"forte.data.ontology.top.Annotation\",\n \"description\": \"Used to represent subword tokenization results.\",\n \"attributes\": [\n {\n \"name\": \"is_first_segment\",\n \"type\": \"bool\"\n },\n {\n \"name\": \"is_unk\",\n \"type\": \"bool\"\n },\n {\n \"name\": \"vocab_id\",\n \"type\": \"int\"\n }\n ]\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.Classification\",\n \"parent_entry\": \"forte.data.ontology.top.Generics\",\n \"description\": \"Used to store values for classification prediction\",\n \"attributes\": [\n {\n \"name\": \"classification_result\",\n \"type\": \"Dict\",\n \"key_type\": \"str\",\n \"value_type\": \"float\"\n }\n ]\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.Document\",\n \"parent_entry\": \"forte.data.ontology.top.Annotation\",\n \"description\": \"A span based annotation `Document`, normally used to represent a document.\",\n \"attributes\": [\n {\n \"name\": \"document_class\",\n \"type\": \"List\",\n \"item_type\": \"str\",\n \"description\": \"A list of class names that the document belongs to.\"\n },\n {\n \"name\": \"sentiment\",\n \"type\": \"Dict\",\n \"key_type\": \"str\",\n \"value_type\": \"float\"\n },\n {\n \"name\": \"classifications\",\n \"type\": \"Dict\",\n \"key_type\": \"str\",\n \"value_type\": \"ft.onto.base_ontology.Classification\",\n \"description\": \"Stores the classification results for this document. The key is the name/task of the classification, the value is an classification object storing the results.\"\n }\n ]\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.Sentence\",\n \"parent_entry\": \"forte.data.ontology.top.Annotation\",\n \"description\": \"A span based annotation `Sentence`, normally used to represent a sentence.\",\n \"attributes\": [\n {\n \"name\": \"speaker\",\n \"type\": \"str\"\n },\n {\n \"name\": \"part_id\",\n \"type\": \"int\"\n },\n {\n \"name\": \"sentiment\",\n \"type\": \"Dict\",\n \"key_type\": \"str\",\n \"value_type\": \"float\"\n },\n {\n \"name\": \"classification\",\n \"type\": \"Dict\",\n \"key_type\": \"str\",\n \"value_type\": \"float\"\n },\n {\n \"name\": \"classifications\",\n \"type\": \"Dict\",\n \"key_type\": \"str\",\n \"value_type\": \"ft.onto.base_ontology.Classification\",\n \"description\": \"Stores the classification results for this sentence. The key is the name/task of the classification, the value is an classification object storing the results.\"\n }\n ]\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.Phrase\",\n \"parent_entry\": \"forte.data.ontology.top.Annotation\",\n \"description\": \"A span based annotation `Phrase`.\",\n \"attributes\": [\n {\n \"name\": \"phrase_type\",\n \"type\": \"str\"\n },\n {\n \"name\": \"headword\",\n \"type\": \"ft.onto.base_ontology.Token\"\n }\n ]\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.UtteranceContext\",\n \"parent_entry\": \"forte.data.ontology.top.Annotation\",\n \"description\": \"`UtteranceContext` represents the context part in dialogue.\"\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.Utterance\",\n \"parent_entry\": \"forte.data.ontology.top.Annotation\",\n \"description\": \"A span based annotation `Utterance`, normally used to represent an utterance in dialogue.\",\n \"attributes\": [\n {\n \"name\": \"speaker\",\n \"type\": \"str\"\n }\n ]\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.PredicateArgument\",\n \"parent_entry\": \"forte.data.ontology.top.Annotation\",\n \"description\": \"A span based annotation `PredicateArgument`, normally used to represent an argument of a predicate, can be linked to the predicate via the predicate link.\",\n \"attributes\": [\n {\n \"name\": \"ner_type\",\n \"type\": \"str\"\n },\n {\n \"name\": \"predicate_lemma\",\n \"type\": \"str\"\n },\n {\n \"name\": \"is_verb\",\n \"type\": \"bool\"\n }\n ]\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.EntityMention\",\n \"parent_entry\": \"forte.data.ontology.top.Annotation\",\n \"description\": \"A span based annotation `EntityMention`, normally used to represent an Entity Mention in a piece of text.\",\n \"attributes\": [\n {\n \"name\": \"ner_type\",\n \"type\": \"str\"\n }\n ]\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.EventMention\",\n \"parent_entry\": \"forte.data.ontology.top.Annotation\",\n \"description\": \"A span based annotation `EventMention`, used to refer to a mention of an event.\",\n \"attributes\": [\n {\n \"name\": \"event_type\",\n \"type\": \"str\"\n }\n ]\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.PredicateMention\",\n \"parent_entry\": \"ft.onto.base_ontology.Phrase\",\n \"description\": \"A span based annotation `PredicateMention`, normally used to represent a predicate (normally verbs) in a piece of text.\",\n \"attributes\": [\n {\n \"name\": \"predicate_lemma\",\n \"type\": \"str\"\n },\n {\n \"name\": \"framenet_id\",\n \"type\": \"str\"\n },\n {\n \"name\": \"is_verb\",\n \"type\": \"bool\"\n }\n ]\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.PredicateLink\",\n \"parent_entry\": \"forte.data.ontology.top.Link\",\n \"description\": \"A `Link` type entry which represent a semantic role link between a predicate and its argument.\",\n \"attributes\": [\n {\n \"name\": \"arg_type\",\n \"type\": \"str\",\n \"description\": \"The predicate link type.\"\n }\n ],\n \"parent_type\": \"ft.onto.base_ontology.PredicateMention\",\n \"child_type\": \"ft.onto.base_ontology.PredicateArgument\"\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.Dependency\",\n \"parent_entry\": \"forte.data.ontology.top.Link\",\n \"description\": \"A `Link` type entry which represent a syntactic dependency.\",\n \"attributes\": [\n {\n \"name\": \"dep_label\",\n \"type\": \"str\",\n \"description\": \"The dependency label.\"\n },\n {\n \"name\": \"rel_type\",\n \"type\": \"str\"\n }\n ],\n \"parent_type\": \"ft.onto.base_ontology.Token\",\n \"child_type\": \"ft.onto.base_ontology.Token\"\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.EnhancedDependency\",\n \"parent_entry\": \"forte.data.ontology.top.Link\",\n \"description\": \"A `Link` type entry which represent a enhanced dependency: \\n https://universaldependencies.org/u/overview/enhanced-syntax.html\",\n \"attributes\": [\n {\n \"name\": \"dep_label\",\n \"type\": \"str\",\n \"description\": \"The enhanced dependency label in Universal Dependency.\"\n }\n ],\n \"parent_type\": \"ft.onto.base_ontology.Token\",\n \"child_type\": \"ft.onto.base_ontology.Token\"\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.RelationLink\",\n \"parent_entry\": \"forte.data.ontology.top.Link\",\n \"description\": \"A `Link` type entry which represent a relation between two entity mentions\",\n \"attributes\": [\n {\n \"name\": \"rel_type\",\n \"type\": \"str\",\n \"description\": \"The type of the relation.\"\n }\n ],\n \"parent_type\": \"ft.onto.base_ontology.EntityMention\",\n \"child_type\": \"ft.onto.base_ontology.EntityMention\"\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.CrossDocEntityRelation\",\n \"parent_entry\": \"forte.data.ontology.top.MultiPackLink\",\n \"description\": \"A `Link` type entry which represent a relation between two entity mentions across the packs.\",\n \"attributes\": [\n {\n \"name\": \"rel_type\",\n \"type\": \"str\",\n \"description\": \"The type of the relation.\"\n }\n ],\n \"parent_type\": \"ft.onto.base_ontology.EntityMention\",\n \"child_type\": \"ft.onto.base_ontology.EntityMention\"\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.CoreferenceGroup\",\n \"parent_entry\": \"forte.data.ontology.top.Group\",\n \"description\": \"A group type entry that take `EntityMention`, as members, used to represent coreferent group of entities.\",\n \"member_type\": \"ft.onto.base_ontology.EntityMention\"\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.EventRelation\",\n \"parent_entry\": \"forte.data.ontology.top.Link\",\n \"description\": \"A `Link` type entry which represent a relation between two event mentions.\",\n \"attributes\": [\n {\n \"name\": \"rel_type\",\n \"type\": \"str\",\n \"description\": \"The type of the relation.\"\n }\n ],\n \"parent_type\": \"ft.onto.base_ontology.EventMention\",\n \"child_type\": \"ft.onto.base_ontology.EventMention\"\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.CrossDocEventRelation\",\n \"parent_entry\": \"forte.data.ontology.top.MultiPackLink\",\n \"description\": \"A `Link` type entry which represent a relation between two event mentions across the packs.\",\n \"attributes\": [\n {\n \"name\": \"rel_type\",\n \"type\": \"str\",\n \"description\": \"The type of the relation.\"\n }\n ],\n \"parent_type\": \"ft.onto.base_ontology.EventMention\",\n \"child_type\": \"ft.onto.base_ontology.EventMention\"\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.ConstituentNode\",\n \"parent_entry\": \"forte.data.ontology.top.Annotation\",\n \"description\": \"A span based annotation `ConstituentNode` to represent constituents in constituency parsing. This can also sentiment values annotated on the nodes.\",\n \"attributes\": [\n {\n \"name\": \"label\",\n \"type\": \"str\"\n },\n {\n \"name\": \"sentiment\",\n \"type\": \"Dict\",\n \"key_type\": \"str\",\n \"value_type\": \"float\"\n },\n {\n \"name\": \"is_root\",\n \"type\": \"bool\"\n },\n {\n \"name\": \"is_leaf\",\n \"type\": \"bool\"\n },\n {\n \"name\": \"parent_node\",\n \"type\": \"ft.onto.base_ontology.ConstituentNode\"\n },\n {\n \"name\": \"children_nodes\",\n \"type\": \"List\",\n \"item_type\": \"ft.onto.base_ontology.ConstituentNode\"\n }\n ]\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.Title\",\n \"parent_entry\": \"forte.data.ontology.top.Annotation\",\n \"description\": \"A span based annotation `Title`, normally used to represent a title.\"\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.Body\",\n \"parent_entry\": \"forte.data.ontology.top.Annotation\",\n \"description\": \"A span based annotation `Body`, normally used to represent a document body.\"\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.MCOption\",\n \"parent_entry\": \"forte.data.ontology.top.Annotation\"\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.MCQuestion\",\n \"parent_entry\": \"forte.data.ontology.top.Annotation\",\n \"attributes\": [\n {\n \"name\": \"options\",\n \"type\": \"List\",\n \"item_type\": \"ft.onto.base_ontology.MCOption\"\n },\n {\n \"name\": \"answers\",\n \"type\": \"List\",\n \"item_type\": \"int\"\n }\n ]\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.MRCQuestion\",\n \"parent_entry\": \"forte.data.ontology.top.Annotation\",\n \"description\": \"An `Annotation` type which represents an MRC question.\",\n \"attributes\": [\n {\n \"name\": \"qid\",\n \"type\": \"int\"\n },\n {\n \"name\": \"answers\",\n \"type\": \"List\",\n \"item_type\": \"ft.onto.base_ontology.Phrase\"\n }\n ]\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.Recording\",\n \"parent_entry\": \"forte.data.ontology.top.AudioAnnotation\",\n \"description\": \"A span based annotation `Recording`, normally used to represent a recording.\",\n \"attributes\": [\n {\n \"name\": \"recording_class\",\n \"type\": \"List\",\n \"item_type\": \"str\",\n \"description\": \"A list of class names that the recording belongs to.\"\n }\n ]\n },\n {\n \"entry_name\": \"ft.onto.base_ontology.AudioUtterance\",\n \"parent_entry\": \"forte.data.ontology.top.AudioAnnotation\",\n \"description\": \"A span based annotation `AudioUtterance`, normally used to represent an utterance in dialogue.\",\n \"attributes\": [\n {\n \"name\": \"speaker\",\n \"type\": \"str\"\n }\n ]\n },\n {\n \"entry_name\": \"ftx.medical.clinical_ontology.NegationContext\",\n \"parent_entry\": \"forte.data.ontology.top.Annotation\",\n \"description\": \"A span based annotation `NegationContext`, used to represent the negation context of a named entity.\",\n \"attributes\": [\n {\n \"name\": \"polarity\",\n \"type\": \"bool\"\n }\n ]\n },\n {\n \"entry_name\": \"ftx.medical.clinical_ontology.MedicalEntityMention\",\n \"parent_entry\": \"ft.onto.base_ontology.EntityMention\",\n \"description\": \"A span based annotation class MedicalEntityMention, used to represent an Entity Mention in medical domain\",\n \"attributes\": [\n {\n \"name\": \"umls_link\",\n \"type\": \"str\"\n },\n {\n \"name\": \"umls_entities\",\n \"type\": \"List\",\n \"item_type\": \"ftx.medical.clinical_ontology.UMLSConceptLink\"\n }\n ]\n },\n {\n \"entry_name\": \"ftx.medical.clinical_ontology.MedicalArticle\",\n \"parent_entry\": \"forte.data.ontology.top.Annotation\",\n \"description\": \"An annotation based representation for the whole medical text chunk/document\",\n \"attributes\": [\n {\n \"name\": \"icd_version\",\n \"type\": \"int\",\n \"description\": \"The version of ICD-Coding being used.\"\n },\n {\n \"name\": \"icd_code\",\n \"type\": \"str\",\n \"description\": \"The ICD code assigned to current medical article.\"\n }\n ]\n }\n ]\n}\n", "config": "{\"legendConfigs\":{\"ft.onto.base_ontology.Token\":{\"is_selected\":false,\"is_shown\":true,\"attributes\":{\"pos\":false,\"ud_xpos\":false,\"lemma\":false,\"chunk\":false,\"ner\":false,\"sense\":false}},\"ft.onto.base_ontology.Subword\":{\"is_selected\":false,\"is_shown\":true,\"attributes\":{}},\"ft.onto.base_ontology.Classification\":{\"is_selected\":false,\"is_shown\":false,\"attributes\":{}},\"ft.onto.base_ontology.Document\":{\"is_selected\":false,\"is_shown\":true,\"attributes\":{}},\"ft.onto.base_ontology.Sentence\":{\"is_selected\":false,\"is_shown\":true,\"attributes\":{\"speaker\":false}},\"ft.onto.base_ontology.Phrase\":{\"is_selected\":false,\"is_shown\":true,\"attributes\":{\"phrase_type\":false}},\"ft.onto.base_ontology.UtteranceContext\":{\"is_selected\":false,\"is_shown\":false},\"ft.onto.base_ontology.Utterance\":{\"is_selected\":false,\"is_shown\":false,\"attributes\":{\"speaker\":false}},\"ft.onto.base_ontology.PredicateArgument\":{\"is_selected\":false,\"is_shown\":false,\"attributes\":{\"ner_type\":false,\"predicate_lemma\":false}},\"ft.onto.base_ontology.EntityMention\":{\"is_selected\":false,\"is_shown\":true,\"attributes\":{\"ner_type\":false}},\"ft.onto.base_ontology.EventMention\":{\"is_selected\":false,\"is_shown\":true,\"attributes\":{\"event_type\":false}},\"ft.onto.base_ontology.PredicateMention\":{\"is_selected\":false,\"is_shown\":true,\"attributes\":{\"predicate_lemma\":false,\"framenet_id\":false}},\"ft.onto.base_ontology.PredicateLink\":{\"is_selected\":false,\"is_shown\":false,\"attributes\":{\"arg_type\":false}},\"ft.onto.base_ontology.Dependency\":{\"is_selected\":false,\"is_shown\":false,\"attributes\":{\"dep_label\":false,\"rel_type\":false}},\"ft.onto.base_ontology.EnhancedDependency\":{\"is_selected\":false,\"is_shown\":false,\"attributes\":{\"dep_label\":false}},\"ft.onto.base_ontology.RelationLink\":{\"is_selected\":false,\"is_shown\":true,\"attributes\":{\"rel_type\":false}},\"ft.onto.base_ontology.CrossDocEntityRelation\":{\"is_selected\":false,\"is_shown\":false,\"attributes\":{\"rel_type\":false}},\"ft.onto.base_ontology.CoreferenceGroup\":{\"is_selected\":false,\"is_shown\":false},\"ft.onto.base_ontology.EventRelation\":{\"is_selected\":false,\"is_shown\":false,\"attributes\":{\"rel_type\":false}},\"ft.onto.base_ontology.CrossDocEventRelation\":{\"is_selected\":false,\"is_shown\":false,\"attributes\":{\"rel_type\":false}},\"ft.onto.base_ontology.ConstituentNode\":{\"is_selected\":false,\"is_shown\":false,\"attributes\":{\"label\":false}},\"ft.onto.base_ontology.Title\":{\"is_selected\":false,\"is_shown\":false},\"ft.onto.base_ontology.Body\":{\"is_selected\":false,\"is_shown\":false},\"ft.onto.base_ontology.MCOption\":{\"is_selected\":false,\"is_shown\":false},\"ft.onto.base_ontology.MCQuestion\":{\"is_selected\":false,\"is_shown\":false,\"attributes\":{}},\"ft.onto.base_ontology.MRCQuestion\":{\"is_selected\":false,\"is_shown\":false,\"attributes\":{}},\"ft.onto.base_ontology.Recording\":{\"is_selected\":false,\"is_shown\":false,\"attributes\":{}},\"ft.onto.base_ontology.AudioUtterance\":{\"is_selected\":false,\"is_shown\":false,\"attributes\":{\"speaker\":false}},\"ftx.medical.clinical_ontology.NegationContext\":{\"is_selected\":false,\"is_shown\":true,\"attributes\":{}},\"ftx.medical.clinical_ontology.MedicalEntityMention\":{\"is_selected\":false,\"is_shown\":true,\"attributes\":{\"umls_link\":false}},\"ftx.medical.clinical_ontology.MedicalArticle\":{\"is_selected\":false,\"is_shown\":true,\"attributes\":{\"icd_code\":false}}},\"scopeConfigs\":{\"ft.onto.base_ontology.Token\":false,\"ft.onto.base_ontology.Subword\":false,\"ft.onto.base_ontology.Document\":false,\"ft.onto.base_ontology.Sentence\":false,\"ft.onto.base_ontology.Phrase\":false,\"ft.onto.base_ontology.UtteranceContext\":false,\"ft.onto.base_ontology.Utterance\":false,\"ft.onto.base_ontology.PredicateArgument\":false,\"ft.onto.base_ontology.EntityMention\":false,\"ft.onto.base_ontology.EventMention\":false,\"ft.onto.base_ontology.PredicateMention\":false,\"ft.onto.base_ontology.ConstituentNode\":false,\"ft.onto.base_ontology.Title\":false,\"ft.onto.base_ontology.Body\":false,\"ft.onto.base_ontology.MCOption\":false,\"ft.onto.base_ontology.MCQuestion\":false,\"ft.onto.base_ontology.MRCQuestion\":false,\"ftx.medical.clinical_ontology.NegationContext\":false,\"ftx.medical.clinical_ontology.MedicalEntityMention\":false,\"ftx.medical.clinical_ontology.MedicalArticle\":false},\"layoutConfigs\":{\"center-middle\":\"default-nlp\",\"left\":\"default-meta\",\"right\":\"default-attribute\",\"center-bottom\":\"disable\"},\"remoteConfigs\":{\"pipelineUrl\":\"\",\"doValidation\":false,\"expectedName\":\"\",\"inputFormat\":\"string\",\"expectedRecords\":{}}}"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, these other JSON files are also not valid JSON.

```bash
pip install forte.elastic
pip install forte.spacy
pip install forte.nltk
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The instruction should include stave installation, which is simply pip install stave

@@ -30,32 +39,43 @@ You also need to set up elastic searcher by following guide below to run the pip
https://www.elastic.co/guide/en/elasticsearch/reference/current/starting-elasticsearch.html
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elasticsearch is actually quite easy to set up, probably just download, unzip and install. It would be helpful if we can show some simple setup steps here (and of course we can leave more reading to the elastic search site).


def main(
input_path: str, output_path: str, max_packs: int = -1, run_ner_pipeline=0
):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I ran this I will have ModuleNotFoundError: No module named 'ftx.medical, instructions to add the ontology?

"drop_record": True,
"zip_pack": True,
},
if run_ner_pipeline == 1:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we placing two scripts into this one main function? One is this NER pipeline, and the other is the search pipeline. Just make them two scripts so that we don't have to worry about to use this run_ner_pipeline parameter


def update_stave_db(
default_project_json, chat_project_json, chat_doc_json, config
):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we explain what the function is doing? And what are the parameters?

@Piyush13y
Copy link
Collaborator Author

@hunterhector I am assuming we are planning to abandon this PR, now that we have a PR in ForteHealth to add this example there? Or do we want to push it here too?

@hunterhector
Copy link
Member

@hunterhector I am assuming we are planning to abandon this PR, now that we have a PR in ForteHealth to add this example there? Or do we want to push it here too?

If everything is moved there we should remove one of them (probably this one). Otherwise, we will have to maintain multiple versions

@Piyush13y
Copy link
Collaborator Author

@hunterhector I am assuming we are planning to abandon this PR, now that we have a PR in ForteHealth to add this example there? Or do we want to push it here too?

If everything is moved there we should remove one of them (probably this one). Otherwise, we will have to maintain multiple versions

We will then have to remove the whole example here then? Because it won't work the old way now that Stave uses RemoteProcessors. As in, removing the clinical_processing_pipeline folder itself from forte/examples; or we will have to strip some functionalities and just keep a non stave interaction example, but that again would be an effective copy of our MIMIC3 example in ForteHealth? https://github.com/asyml/ForteHealth/blob/master/examples/mimic_iii/medical_pipeline.py

@hunterhector
Copy link
Member

@hunterhector I am assuming we are planning to abandon this PR, now that we have a PR in ForteHealth to add this example there? Or do we want to push it here too?

If everything is moved there we should remove one of them (probably this one). Otherwise, we will have to maintain multiple versions

We will then have to remove the whole example here then? Because it won't work the old way now that Stave uses RemoteProcessors. As in, removing the clinical_processing_pipeline folder itself from forte/examples; or we will have to strip some functionalities and just keep a non stave interaction example, but that again would be an effective copy of our MIMIC3 example in ForteHealth? https://github.com/asyml/ForteHealth/blob/master/examples/mimic_iii/medical_pipeline.py

I think we can just remove the whole thing since we have a complete example in the other repo

@hunterhector
Copy link
Member

close since most of the code is moved out and this pr is inactive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve the clinical_pipeline example
2 participants