Skip to content

Commit

Permalink
fix: retrieve spelling corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
dlangst committed Dec 3, 2021
1 parent 4bb34c9 commit 3631a05
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3756,7 +3756,7 @@ class ContainerAnnotation(object):
:attr list[Section] sections: (optional)
:attr list[NluEntities] nlu_entities: (optional)
:attr list[Relations] relations: (optional)
:attr list[SpellingCorrection]: (optional)
:attr list[SpellingCorrection] spelling_corrections: (optional)
:attr list[SpellCorrectedText] spell_corrected_text: (optional)
:attr list[Temporal] temporal_spans: (optional)
:attr list[Annotation] lines: (optional)
Expand Down Expand Up @@ -3805,7 +3805,7 @@ def __init__(self, allergy_ind=None, allergy_medication_ind=None, attribute_valu
:param list[Section] sections: (optional)
:param list[NluEntities] nlu_entities: (optional)
:param list[Relations] relations: (optional)
:param list[SpellingCorrection] spelling_correction: (optional)
:param list[SpellingCorrection] spelling_corrections: (optional)
:param list[SpellCorrectedText] spell_corrected_text: (optional)
:param list[Temporal] temporal_spans: (optional)
:param list[Annotation] lines: (optional)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding: utf-8

# Copyright 2018 IBM All Rights Reserved.
# Copyright 2018, 2021 IBM All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,7 @@

from ibm_whcs_sdk.annotator_for_clinical_data.tests.common import test_suggestion as ts

class TestSpellCorrectionAnnotation(object):
class TestSpellingCorrection(object):

@staticmethod
def test_spelling_correction(annotation_list=None):
Expand All @@ -26,4 +26,4 @@ def test_spelling_correction(annotation_list=None):
assert annotation.end > annotation.begin
assert annotation.covered_text is not None
for suggestion in annotation.suggestions:
ts.TestSuggestion.test_spelling_suggestion(suggestion)
ts.TestSuggestion.test_spelling_suggestions(suggestion)
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from ibm_whcs_sdk.annotator_for_clinical_data.tests.common import test_section as tsec
from ibm_whcs_sdk.annotator_for_clinical_data.tests.common import test_nlu_entities as tne
from ibm_whcs_sdk.annotator_for_clinical_data.tests.common import test_relation as tr
#import tests.functional.test_spell_correction as tsc
from ibm_whcs_sdk.annotator_for_clinical_data.tests.common import test_spelling_correction as tsc
from ibm_whcs_sdk.annotator_for_clinical_data.tests.common import test_spell_corrected_text as tsct
from ibm_whcs_sdk.annotator_for_clinical_data.tests.common import test_temporal_span as tts

Expand Down Expand Up @@ -97,6 +97,8 @@ def test_unstructured_container(data=None):
tne.TestNluEntitiesAnnotation.test_nlu_entities(data.nlu_entities)
if data.relations is not None:
tr.TestRelationAnnotation.test_relation_annotation(data.relations)
if data.spelling_corrections is not None:
tsc.TestSpellingCorrection.test_spelling_correction(data.spelling_corrections)
if data.spell_corrected_text is not None:
tsct.TestSpellCorrectedText.test_spell_corrected_text(data.spell_corrected_text)
if data.temporal_spans is not None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
IAMURL = CONFIG.get('settings', 'iam_url')
VERSION = CONFIG.get('settings', 'version')
LEVEL = CONFIG.get('settings', 'logging_level')
DISABLE_SSL = (CONFIG.get('settings', 'disable_ssl')=='True)
DISABLE_SSL = (CONFIG.get('settings', 'disable_ssl')=='True')
FLOW = CONFIG.get('settings', 'flow')

ACD = wh.AnnotatorForClinicalDataV1(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding: utf-8

# Copyright 2018 IBM All Rights Reserved.
# Copyright 2018, 2021 IBM All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -25,7 +25,7 @@
IAMURL = CONFIG.get('settings', 'iam_url')
VERSION = CONFIG.get('settings', 'version')
LEVEL = CONFIG.get('settings', 'logging_level')
DISABLE_SSL = (CONFIG.get('settings', 'disable_ssl')=='True)
DISABLE_SSL = (CONFIG.get('settings', 'disable_ssl')=='True')

ACD = wh.AnnotatorForClinicalDataV1(
authenticator=IAMAuthenticator(apikey=APIKEY, url=IAMURL, disable_ssl_verification=DISABLE_SSL),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding: utf-8

# Copyright 2018 IBM All Rights Reserved.
# Copyright 2018, 2021 IBM All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -25,7 +25,7 @@
IAMURL = CONFIG.get('settings', 'iam_url')
VERSION = CONFIG.get('settings', 'version')
LEVEL = CONFIG.get('settings', 'logging_level')
DISABLE_SSL = (CONFIG.get('settings', 'disable_ssl')=='True)
DISABLE_SSL = (CONFIG.get('settings', 'disable_ssl')=='True')
FLOW = CONFIG.get('settings', 'flow')

ACD = wh.AnnotatorForClinicalDataV1(
Expand Down Expand Up @@ -64,7 +64,7 @@ def test_get_bad_flows_id():

def test_create_flow():
test_elementList = []
test_anno = wh.Annotator(name = 'concept_detection')
test_anno = wh.Annotator(name = 'concept_detection', parameters = {"include_optional_fields": ["medical_codes", "source_vocabularies"]})
test_flowEntry = wh.FlowEntry(annotator=test_anno)
test_elementList.append(test_flowEntry)
test_flow = wh.Flow(elements = test_elementList, async_ = False)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding: utf-8

# Copyright 2018 IBM All Rights Reserved.
# Copyright 2018, 2021 IBM All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -25,7 +25,7 @@
IAMURL = CONFIG.get('settings', 'iam_url')
VERSION = CONFIG.get('settings', 'version')
LEVEL = CONFIG.get('settings', 'logging_level')
DISABLE_SSL = (CONFIG.get('settings', 'disable_ssl')=='True)
DISABLE_SSL = (CONFIG.get('settings', 'disable_ssl')=='True')

ACD = wh.AnnotatorForClinicalDataV1(
authenticator=IAMAuthenticator(apikey=APIKEY, url=IAMURL, disable_ssl_verification=DISABLE_SSL),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding: utf-8

# Copyright 2018 IBM All Rights Reserved.
# Copyright 2018, 2021 IBM All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -25,7 +25,7 @@
IAMURL = CONFIG.get('settings', 'iam_url')
VERSION = CONFIG.get('settings', 'version')
LEVEL = CONFIG.get('settings', 'logging_level')
DISABLE_SSL = (CONFIG.get('settings', 'disable_ssl')=='True)
DISABLE_SSL = (CONFIG.get('settings', 'disable_ssl')=='True')
PROFILE = CONFIG.get('settings', 'profile')

ACD = wh.AnnotatorForClinicalDataV1(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding: utf-8

# Copyright 2018 IBM All Rights Reserved.
# Copyright 2018, 2021 IBM All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -25,7 +25,7 @@
IAMURL = CONFIG.get('settings', 'iam_url')
VERSION = CONFIG.get('settings', 'version')
LEVEL = CONFIG.get('settings', 'logging_level')
DISABLE_SSL = CONFIG.get('settings', 'disable_ssl')
DISABLE_SSL = (CONFIG.get('settings', 'disable_ssl')=='True')
PROFILE = CONFIG.get('settings', 'profile')

ACD = wh.AnnotatorForClinicalDataV1(
Expand Down

0 comments on commit 3631a05

Please sign in to comment.