@@ -4215,20 +4215,32 @@ class EnrichmentOptions(object):
42154215
42164216 :attr NluEnrichmentFeatures features: (optional) An object representing the enrichment
42174217 features that will be applied to the specified field.
4218+ :attr str language: (optional) ISO 639-1 code indicating the language to use for the
4219+ analysis. This code overrides the automatic language detection performed by the
4220+ service. Valid codes are `ar` (Arabic), `en` (English), `fr` (French), `de` (German),
4221+ `it` (Italian), `pt` (Portuguese), `ru` (Russian), `es` (Spanish), and `sv` (Swedish).
4222+ **Note:** Not all features support all languages, automatic detection is recommended.
42184223 :attr str model: (optional) *For use with `elements` enrichments only.* The element
42194224 extraction model to use. Models available are: `contract`.
42204225 """
42214226
4222- def __init__ (self , features = None , model = None ):
4227+ def __init__ (self , features = None , language = None , model = None ):
42234228 """
42244229 Initialize a EnrichmentOptions object.
42254230
42264231 :param NluEnrichmentFeatures features: (optional) An object representing the
42274232 enrichment features that will be applied to the specified field.
4233+ :param str language: (optional) ISO 639-1 code indicating the language to use for
4234+ the analysis. This code overrides the automatic language detection performed by
4235+ the service. Valid codes are `ar` (Arabic), `en` (English), `fr` (French), `de`
4236+ (German), `it` (Italian), `pt` (Portuguese), `ru` (Russian), `es` (Spanish), and
4237+ `sv` (Swedish). **Note:** Not all features support all languages, automatic
4238+ detection is recommended.
42284239 :param str model: (optional) *For use with `elements` enrichments only.* The
42294240 element extraction model to use. Models available are: `contract`.
42304241 """
42314242 self .features = features
4243+ self .language = language
42324244 self .model = model
42334245
42344246 @classmethod
@@ -4238,6 +4250,8 @@ def _from_dict(cls, _dict):
42384250 if 'features' in _dict :
42394251 args ['features' ] = NluEnrichmentFeatures ._from_dict (
42404252 _dict .get ('features' ))
4253+ if 'language' in _dict :
4254+ args ['language' ] = _dict .get ('language' )
42414255 if 'model' in _dict :
42424256 args ['model' ] = _dict .get ('model' )
42434257 return cls (** args )
@@ -4247,6 +4261,8 @@ def _to_dict(self):
42474261 _dict = {}
42484262 if hasattr (self , 'features' ) and self .features is not None :
42494263 _dict ['features' ] = self .features ._to_dict ()
4264+ if hasattr (self , 'language' ) and self .language is not None :
4265+ _dict ['language' ] = self .language
42504266 if hasattr (self , 'model' ) and self .model is not None :
42514267 _dict ['model' ] = self .model
42524268 return _dict
0 commit comments