fix: model lang

This commit is contained in:
Mohamed Marrouchi 2024-09-19 10:52:18 +01:00
parent c58a080ebf
commit dab9d9f716
3 changed files with 4 additions and 4 deletions

View File

@ -102,10 +102,10 @@ class JISFDL(tfbp.DataLoader):
lang = self.hparams.language
all_examples = data["common_examples"]
if not lang:
if not bool(lang):
examples = all_examples
else:
examples = filter(lambda exp: any(not lang or (e['entity'] == 'language' and e['value'] == lang) for e in exp['entities']), all_examples)
examples = filter(lambda exp: any(e['entity'] == 'language' and e['value'] == lang for e in exp['entities']), all_examples)
# Parse raw data
for exp in examples:

View File

@ -38,7 +38,7 @@ BERT_MODEL_BY_LANGUAGE = {
@tfbp.default_export
class IntentClassifier(tfbp.Model):
default_hparams = {
"language": None,
"language": "",
"num_epochs": 2,
"dropout_prob": 0.1,
"intent_num_labels": 7,

View File

@ -38,7 +38,7 @@ BERT_MODEL_BY_LANGUAGE = {
@tfbp.default_export
class SlotFiller(tfbp.Model):
default_hparams = {
"language": None,
"language": "",
"num_epochs": 2,
"dropout_prob": 0.1,
"slot_num_labels": 40