Skip to content

Clinical example fix #632

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

Merged
merged 3 commits into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions examples/clinical_pipeline/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ python ./download_models.py
**Note**: The above script will save the model in `resources/NCBI-disease`. Use `--path` option to save the
model into a different directory.

## Prepare elastic searcher
You also need to set up elastic searcher by following guide below to run the pipeline.

https://www.elastic.co/guide/en/elasticsearch/reference/current/starting-elasticsearch.html


## Run indexer
First, you should start an Elastic Indexer backend.

Expand Down
5 changes: 2 additions & 3 deletions examples/clinical_pipeline/clinical_processing_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from forte.processors.writers import PackIdJsonPackWriter

from fortex.elastic import ElasticSearchPackIndexProcessor
from fortex.hugginface.bio_ner_predictor import BioBERTNERPredictor
from fortex.hugginface.transformers_processor import BERTTokenizer
from fortex.huggingface.bio_ner_predictor import BioBERTNERPredictor
from fortex.huggingface.transformers_processor import BERTTokenizer
from fortex.nltk import NLTKSentenceSegmenter

def main(input_path: str, output_path: str, max_packs: int = -1):
Expand Down Expand Up @@ -40,7 +40,6 @@ def main(input_path: str, output_path: str, max_packs: int = -1):
)

pl.initialize()

for idx, _ in enumerate(pl.process_dataset(input_path)):
if (idx + 1) % 50 == 0:
print(f"{time.strftime('%m-%d %H:%M')}: Processed {idx + 1} packs")
Expand Down