Skip to content

Commit

Permalink
Merge branch '3.4.3rc1' into improved-nlu-component-access
Browse files Browse the repository at this point in the history
  • Loading branch information
C-K-Loan committed Apr 13, 2022
2 parents 545f950 + 668e04d commit fe3bc6e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nlu/pipe/utils/resolution/nlu_ref_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def parse_language_from_nlu_ref(nlu_ref):
if nlu_ref[0:3] != 'xx.':
nlu_reference = 'xx.' + nlu_ref
logger.info(f'Setting lang as xx for nlu_ref={nlu_reference}')
if not lang :
if not lang:
lang = 'en'
logger.info(f'Parsed Nlu_ref={nlu_ref} as lang={lang}')

Expand All @@ -59,6 +59,10 @@ def nlu_ref_to_nlp_metadata(nlu_ref, is_recursive_call=False):
nlp_ref = None
license_type = Licenses.open_source
is_pipe = False
if 'translate_to' in nlu_ref:
# We append here xx and set lang as xx so users don't have to specify it
nlu_ref = 'xx.' + nlu_ref
lang = 'xx'
# 1. check if open source pipeline
if lang in Spellbook.pretrained_pipe_references.keys():
if nlu_ref in Spellbook.pretrained_pipe_references[lang].keys():
Expand All @@ -75,7 +79,7 @@ def nlu_ref_to_nlp_metadata(nlu_ref, is_recursive_call=False):
sparknlp_data = Spellbook.component_alias_references[nlu_ref]
nlp_ref = sparknlp_data[0]
is_pipe = 'component_list' in sparknlp_data[1]
if len(sparknlp_data) == 3 :
if len(sparknlp_data) == 3:
model_params = sparknlp_data[2]
# 4. check if healthcare pipe
if lang in Spellbook.pretrained_healthcare_pipe_references.keys():
Expand Down

0 comments on commit fe3bc6e

Please sign in to comment.