INSTRUCTION
stringlengths
1
8.43k
RESPONSE
stringlengths
75
104k
Initialize a AcousticModels object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a AcousticModels object from a json dictionary.""" args = {} if 'customizations' in _dict: args['customizations'] = [ AcousticModel._from_dict(x) for x in (_dict.get('customizations')) ] els...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'customizations') and self.customizations is not None: _dict['customizations'] = [ x._to_dict() for x in self.customizations ] return _dict
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type if hasattr(self, 'codec') and self.codec is not None: _dict['codec'] = self.codec if hasatt...
Initialize a AudioListing object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a AudioListing object from a json dictionary.""" args = {} if 'duration' in _dict: args['duration'] = _dict.get('duration') if 'name' in _dict: args['name'] = _dict.get('name') if 'details' in _dict: ar...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'duration') and self.duration is not None: _dict['duration'] = self.duration if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name ...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'duration') and self.duration is not None: _dict['duration'] = self.duration if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name ...
Initialize a AudioResources object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a AudioResources object from a json dictionary.""" args = {} if 'total_minutes_of_audio' in _dict: args['total_minutes_of_audio'] = _dict.get('total_minutes_of_audio') else: raise ValueError( 'Required prop...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'total_minutes_of_audio' ) and self.total_minutes_of_audio is not None: _dict['total_minutes_of_audio'] = self.total_minutes_of_audio if hasattr(self, 'au...
Initialize a Corpora object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a Corpora object from a json dictionary.""" args = {} if 'corpora' in _dict: args['corpora'] = [ Corpus._from_dict(x) for x in (_dict.get('corpora')) ] else: raise ValueError( 'R...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'corpora') and self.corpora is not None: _dict['corpora'] = [x._to_dict() for x in self.corpora] return _dict
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'word') and self.word is not None: _dict['word'] = self.word if hasattr(self, 'sounds_like') and self.sounds_like is not None: _dict['sounds_like'] = self.sound...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'out_of_vocabulary_words' ) and self.out_of_vocabulary_words is not None: ...
Initialize a Grammars object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a Grammars object from a json dictionary.""" args = {} if 'grammars' in _dict: args['grammars'] = [ Grammar._from_dict(x) for x in (_dict.get('grammars')) ] else: raise ValueError( ...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'grammars') and self.grammars is not None: _dict['grammars'] = [x._to_dict() for x in self.grammars] return _dict
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'normalized_text') and self.normalized_text is not None: _dict['normalized_text'] = self.normalized_text if hasattr(self, 'start_time') and self.start_ti...
Initialize a LanguageModels object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a LanguageModels object from a json dictionary.""" args = {} if 'customizations' in _dict: args['customizations'] = [ LanguageModel._from_dict(x) for x in (_dict.get('customizations')) ] els...
Initialize a RecognitionJob object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a RecognitionJob object from a json dictionary.""" args = {} if 'id' in _dict: args['id'] = _dict.get('id') else: raise ValueError( 'Required property \'id\' not present in RecognitionJob JSON') if ...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr(se...
Initialize a RecognitionJobs object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a RecognitionJobs object from a json dictionary.""" args = {} if 'recognitions' in _dict: args['recognitions'] = [ RecognitionJob._from_dict(x) for x in (_dict.get('recognitions')) ] else: ...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'recognitions') and self.recognitions is not None: _dict['recognitions'] = [x._to_dict() for x in self.recognitions] return _dict
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr(self, 'url') and self.url is not None: _dict['url'] = self.url return _d...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'from_') and self.from_ is not None: _dict['from'] = self.from_ if hasattr(self, 'to') and self.to is not None: _dict['to'] = self.to if hasattr(self, '...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'language') and self.language is not None: _dict['language'] = self.language ...
Initialize a SpeechModels object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a SpeechModels object from a json dictionary.""" args = {} if 'models' in _dict: args['models'] = [ SpeechModel._from_dict(x) for x in (_dict.get('models')) ] else: raise ValueError( ...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'transcript') and self.transcript is not None: _dict['transcript'] = self.transcript if hasattr(self, 'confidence') and self.confidence is not None: _dict['conf...
Initialize a SpeechRecognitionResult object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a SpeechRecognitionResult object from a json dictionary.""" args = {} if 'final' in _dict or 'final_results' in _dict: args['final_results'] = _dict.get('final') or _dict.get( 'final_results') else: raise V...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'final_results') and self.final_results is not None: _dict['final'] = self.final_results if hasattr(self, 'alternatives') and self.alternatives is not None: _di...
Initialize a SpeechRecognitionResults object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a SpeechRecognitionResults object from a json dictionary.""" args = {} if 'results' in _dict: args['results'] = [ SpeechRecognitionResult._from_dict(x) for x in (_dict.get('results')) ] if '...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'results') and self.results is not None: _dict['results'] = [x._to_dict() for x in self.results] if hasattr(self, 'result_index') and self.result_index is not None: ...
Initialize a SupportedFeatures object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a SupportedFeatures object from a json dictionary.""" args = {} if 'custom_language_model' in _dict: args['custom_language_model'] = _dict.get('custom_language_model') else: raise ValueError( 'Required prop...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'custom_language_model' ) and self.custom_language_model is not None: _dict['custom_language_model'] = self.custom_language_model if hasattr(self, 'speake...
Initialize a Word object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a Word object from a json dictionary.""" args = {} if 'word' in _dict: args['word'] = _dict.get('word') else: raise ValueError( 'Required property \'word\' not present in Word JSON') if 'sounds_like...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'word') and self.word is not None: _dict['word'] = self.word if hasattr(self, 'sounds_like') and self.sounds_like is not None: _dict['sounds_like'] = self.sound...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'confidence') and self.confidence is not None: _dict['confidence'] = self.confidence if hasattr(self, 'word') and self.word is not None: _dict['word'] = self.wo...
Initialize a WordAlternativeResults object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a WordAlternativeResults object from a json dictionary.""" args = {} if 'start_time' in _dict: args['start_time'] = _dict.get('start_time') else: raise ValueError( 'Required property \'start_time\' not pres...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'start_time') and self.start_time is not None: _dict['start_time'] = self.start_time if hasattr(self, 'end_time') and self.end_time is not None: _dict['end_time...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'element') and self.element is not None: _dict['element'] = self.element return _dict
Initialize a Words object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a Words object from a json dictionary.""" args = {} if 'words' in _dict: args['words'] = [Word._from_dict(x) for x in (_dict.get('words'))] else: raise ValueError( 'Required property \'words\' not present i...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'words') and self.words is not None: _dict['words'] = [x._to_dict() for x in self.words] return _dict
updateUserTone processes the Tone Analyzer payload to pull out the emotion writing and social tones and identify the meaningful tones ( i. e. those tones that meet the specified thresholds ). The conversationPayload json object is updated to include these tones.
def updateUserTone(conversationPayload, toneAnalyzerPayload, maintainHistory): """ updateUserTone processes the Tone Analyzer payload to pull out the emotion, writing and social tones, and identify the meaningful tones (i.e., those tones that meet the specified thresholds). The conversationPayload j...
updateEmotionTone updates the user emotion tone with the primary emotion - the emotion tone that has a score greater than or equal to the EMOTION_SCORE_THRESHOLD ; otherwise primary emotion will be neutral
def updateEmotionTone(user, emotionTone, maintainHistory): """ updateEmotionTone updates the user emotion tone with the primary emotion - the emotion tone that has a score greater than or equal to the EMOTION_SCORE_THRESHOLD; otherwise primary emotion will be 'neutral' @param user a json object repr...
updateWritingTone updates the user with the writing tones interpreted based on the specified thresholds
def updateWritingTone(user, writingTone, maintainHistory): """ updateWritingTone updates the user with the writing tones interpreted based on the specified thresholds @param: user a json object representing user information (tone) to be used in conversing with the Conversation Service @param: wr...
updateSocialTone updates the user with the social tones interpreted based on the specified thresholds
def updateSocialTone(user, socialTone, maintainHistory): """ updateSocialTone updates the user with the social tones interpreted based on the specified thresholds @param user a json object representing user information (tone) to be used in conversing with the Conversation Service @param socialTo...
Synthesize audio.
def synthesize(self, text, voice=None, customization_id=None, accept=None, **kwargs): """ Synthesize audio. Synthesizes text to audio that is spoken in the specified voice. The service bases i...
Update a custom model.
def update_voice_model(self, customization_id, name=None, description=None, words=None, **kwargs): """ Update a custom model. Updates information for the specif...
Add a custom word.
def add_word(self, customization_id, word, translation, part_of_speech=None, **kwargs): """ Add a custom word. Adds a single word and its translation to the specified custom voice model. Adding a new tr...
Delete labeled data.
def delete_user_data(self, customer_id, **kwargs): """ Delete labeled data. Deletes all data that is associated with a specified customer ID. The method deletes all data for the customer ID, regardless of the method by which the information was added. The method has no effect if...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'pronunciation') and self.pronunciation is not None: _dict['pronunciation'] = self.pronunciation return _dict
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'custom_pronunciation' ) and self.custom_pronunciation is not None: _dict['custom_pronunciation'] = self.custom_pronunciation if hasattr(self, 'voice_tran...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'url') and self.url is not None: _dict['url'] = self.url if hasattr(self, 'gender') and self.gender is not None: _dict['gender'] = self.gender if hasatt...
Initialize a VoiceModel object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a VoiceModel object from a json dictionary.""" args = {} if 'customization_id' in _dict: args['customization_id'] = _dict.get('customization_id') else: raise ValueError( 'Required property \'customization_i...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'customization_id') and self.customization_id is not None: _dict['customization_id'] = self.customization_id if hasattr(self, 'name') and self.name is no...
Initialize a VoiceModels object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a VoiceModels object from a json dictionary.""" args = {} if 'customizations' in _dict: args['customizations'] = [ VoiceModel._from_dict(x) for x in (_dict.get('customizations')) ] else: raise V...
Initialize a Voices object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a Voices object from a json dictionary.""" args = {} if 'voices' in _dict: args['voices'] = [ Voice._from_dict(x) for x in (_dict.get('voices')) ] else: raise ValueError( 'Requir...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'voices') and self.voices is not None: _dict['voices'] = [x._to_dict() for x in self.voices] return _dict
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'word') and self.word is not None: _dict['word'] = self.word if hasattr(self, 'translation') and self.translation is not None: _dict['translation'] = self.trans...
invokeToneConversation calls the Tone Analyzer service to get the tone information for the user s input text ( input [ text ] in the payload json object ) adds/ updates the user s tone in the payload s context and sends the payload to the conversation service to get a response which is printed to screen.: param payload...
def invokeToneConversation(payload, maintainToneHistoryInContext): """ invokeToneConversation calls the Tone Analyzer service to get the tone information for the user's input text (input['text'] in the payload json object), adds/updates the user's tone in the payload's context, and sends the pay...
Convert document to HTML.
def convert_to_html(self, file, filename=None, file_content_type=None, model=None, **kwargs): """ Convert document to HTML. Converts a document to HTML. :param file f...
Classify the elements of a document.
def classify_elements(self, file, file_content_type=None, model=None, **kwargs): """ Classify the elements of a document. Analyzes the structural and semantic elements of a document. ...
Compare two documents.
def compare_documents(self, file_1, file_2, file_1_content_type=None, file_2_content_type=None, file_1_label=None, file_2_label=None, mode...
Add feedback.
def add_feedback(self, feedback_data, user_id=None, comment=None, **kwargs): """ Add feedback. Adds feedback in the form of _labels_ from a subject-matter expert (SME) to a governing document. **Important:** Feedback is not immediately incorporated into the training model, ...
List a specified feedback entry.
def get_feedback(self, feedback_id, model=None, **kwargs): """ List a specified feedback entry. Lists a feedback entry with a specified `feedback_id`. :param str feedback_id: A string that specifies the feedback entry to be included in the output. :param str model: The ...
List the feedback in a document.
def list_feedback(self, feedback_type=None, before=None, after=None, document_title=None, model_id=None, model_version=None, category_removed=None, ...
Submit a batch - processing request.
def create_batch(self, function, input_credentials_file, input_bucket_location, input_bucket_name, output_credentials_file, output_bucket_location, output_bucket_name, ...
Initialize a AlignedElement object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a AlignedElement object from a json dictionary.""" args = {} if 'element_pair' in _dict: args['element_pair'] = [ ElementPair._from_dict(x) for x in (_dict.get('element_pair')) ] if 'identical_text' in _dic...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'element_pair') and self.element_pair is not None: _dict['element_pair'] = [x._to_dict() for x in self.element_pair] if hasattr(self, 'identical_text') and self.identical_t...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'function') and self.function is not None: _dict['function'] = self.function if hasattr(self, 'input_bucket_location' ) and self.input_bucket_location is ...
Initialize a Batches object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a Batches object from a json dictionary.""" args = {} if 'batches' in _dict: args['batches'] = [ BatchStatus._from_dict(x) for x in (_dict.get('batches')) ] return cls(**args)
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'batches') and self.batches is not None: _dict['batches'] = [x._to_dict() for x in self.batches] return _dict
Initialize a BodyCells object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a BodyCells object from a json dictionary.""" args = {} if 'cell_id' in _dict: args['cell_id'] = _dict.get('cell_id') if 'location' in _dict: args['location'] = Location._from_dict(_dict.get('location')) if 'text' ...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'cell_id') and self.cell_id is not None: _dict['cell_id'] = self.cell_id if hasattr(self, 'location') and self.location is not None: _dict['location'] = self.lo...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'label') and self.label is not None: _dict['label'] = self.label if hasattr(self, 'provenance_ids') and self.provenance_ids is not None: _dict['provenance_ids']...
Initialize a ClassifyReturn object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a ClassifyReturn object from a json dictionary.""" args = {} if 'document' in _dict: args['document'] = Document._from_dict(_dict.get('document')) if 'model_id' in _dict: args['model_id'] = _dict.get('model_id') if...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'document') and self.document is not None: _dict['document'] = self.document._to_dict() if hasattr(self, 'model_id') and self.model_id is not None: _dict['model...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id return _dict
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'text_normalized') and self.text_normalized is not None: _dict['text_normalized'] = self.text_normalized return _dict
Initialize a CompareReturn object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a CompareReturn object from a json dictionary.""" args = {} if 'model_id' in _dict: args['model_id'] = _dict.get('model_id') if 'model_version' in _dict: args['model_version'] = _dict.get('model_version') if 'docum...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'model_id') and self.model_id is not None: _dict['model_id'] = self.model_id if hasattr(self, 'model_version') and self.model_version is not None: _dict['model_...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'role') and self.role is not None: _dict['role'] = self.role return _dict
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'total') and self.total is not None: _dict['total'] = self.total if hasattr(self, 'pending') and self.pending is not None: _dict['pending'] = self.pending ...
Initialize a DocStructure object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a DocStructure object from a json dictionary.""" args = {} if 'section_titles' in _dict: args['section_titles'] = [ SectionTitles._from_dict(x) for x in (_dict.get('section_titles')) ] if 'l...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'section_titles') and self.section_titles is not None: _dict['section_titles'] = [ x._to_dict() for x in self.section_titles ] if hasattr(self, ...
Initialize a Element object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a Element object from a json dictionary.""" args = {} if 'location' in _dict: args['location'] = Location._from_dict(_dict.get('location')) if 'text' in _dict: args['text'] = _dict.get('text') if 'types' in _dict: ...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'begin') and self.begin is not None: _dict['begin'] = self.begin if hasattr(self, 'end') and self.end is not None: _dict['end'] = self.end return _dict
Initialize a FeedbackDataInput object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a FeedbackDataInput object from a json dictionary.""" args = {} if 'feedback_type' in _dict: args['feedback_type'] = _dict.get('feedback_type') else: raise ValueError( 'Required property \'feedback_type\' n...
Initialize a FeedbackDataOutput object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a FeedbackDataOutput object from a json dictionary.""" args = {} if 'feedback_type' in _dict: args['feedback_type'] = _dict.get('feedback_type') if 'document' in _dict: args['document'] = ShortDoc._from_dict(_dict.get('doc...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'feedback_type') and self.feedback_type is not None: _dict['feedback_type'] = self.feedback_type if hasattr(self, 'document') and self.document is not None: _di...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr(self, 'message') and self.message is not None: _dict['message'] = self.message ...
Initialize a FeedbackList object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a FeedbackList object from a json dictionary.""" args = {} if 'feedback' in _dict: args['feedback'] = [ GetFeedback._from_dict(x) for x in (_dict.get('feedback')) ] return cls(**args)
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'feedback') and self.feedback is not None: _dict['feedback'] = [x._to_dict() for x in self.feedback] return _dict
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'feedback_id') and self.feedback_id is not None: _dict['feedback_id'] = self.feedback_id if hasattr(self, 'user_id') and self.user_id is not None: _dict['user_i...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'num_pages') and self.num_pages is not None: _dict['num_pages'] = self.num_pages if hasattr(self, 'author') and self.author is not None: _dict['author'] = self....
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'cell_id') and self.cell_id is not None: _dict['cell_id'] = self.cell_id if hasattr(self, 'location') and self.location is not None: _dict['location'] = self.lo...
Initialize a KeyValuePair object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a KeyValuePair object from a json dictionary.""" args = {} if 'key' in _dict: args['key'] = Key._from_dict(_dict.get('key')) if 'value' in _dict: args['value'] = Value._from_dict(_dict.get('value')) return cls(**ar...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'key') and self.key is not None: _dict['key'] = self.key._to_dict() if hasattr(self, 'value') and self.value is not None: _dict['value'] = self.value._to_dict()...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'nature') and self.nature is not None: _dict['nature'] = self.nature if hasattr(self, 'party') and self.party is not None: _dict['party'] = self.party r...
Initialize a LeadingSentence object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a LeadingSentence object from a json dictionary.""" args = {} if 'text' in _dict: args['text'] = _dict.get('text') if 'location' in _dict: args['location'] = Location._from_dict(_dict.get('location')) if 'element_l...
Initialize a OriginalLabelsIn object from a json dictionary.
def _from_dict(cls, _dict): """Initialize a OriginalLabelsIn object from a json dictionary.""" args = {} if 'types' in _dict: args['types'] = [ TypeLabel._from_dict(x) for x in (_dict.get('types')) ] else: raise ValueError( ...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'types') and self.types is not None: _dict['types'] = [x._to_dict() for x in self.types] if hasattr(self, 'categories') and self.categories is not None: _dict['...
Return a json dictionary representing this model.
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'refresh_cursor') and self.refresh_cursor is not None: _dict['refresh_cursor'] = self.refresh_cursor if hasattr(self, 'next_cursor') and self.next_cursor is not None: ...