Create model.

        Uploads Translation Memory eXchange (TMX) files to customize a translation model.
        You can either customize a model with a forced glossary or with a corpus that
        contains parallel sentences. To create a model that is customized with a parallel
        corpus <b>and</b> a forced glossary, proceed in two steps: customize with a
        parallel corpus first and then customize the resulting model with a glossary.
        Depending on the type of customization and the size of the uploaded corpora,
        training can range from minutes for a glossary to several hours for a large
        parallel corpus. You can upload a single forced glossary file and this file must
        be less than <b>10 MB</b>. You can upload multiple parallel corpora tmx files. The
        cumulative file size of all uploaded files is limited to <b>250 MB</b>. To
        successfully train with a parallel corpus you must have at least <b>5,000 parallel
        sentences</b> in your corpus.
        You can have a <b>maxium of 10 custom models per language pair</b>.

        :param str base_model_id: The model ID of the model to use as the base for
        customization. To see available models, use the `List models` method. Usually all
        IBM provided models are customizable. In addition, all your models that have been
        created via parallel corpus customization, can be further customized with a forced
        glossary.
        :param file forced_glossary: A TMX file with your customizations. The
        customizations in the file completely overwrite the domain translaton data,
        including high frequency or high confidence phrase translations. You can upload
        only one glossary with a file size less than 10 MB per call. A forced glossary
        should contain single words or short phrases.
        :param file parallel_corpus: A TMX file with parallel sentences for source and
        target language. You can upload multiple parallel_corpus files in one request. All
        uploaded parallel_corpus files combined, your parallel corpus must contain at
        least 5,000 parallel sentences to train successfully.
        :param str name: An optional model name that you can use to identify the model.
        Valid characters are letters, numbers, dashes, underscores, spaces and
        apostrophes. The maximum length is 32 characters.
        :param dict headers: A `dict` containing the request headers
        :return: A `DetailedResponse` containing the result, headers and HTTP status code.
        :rtype: DetailedResponse

def create_model(self,
                     base_model_id,
                     forced_glossary=None,
                     parallel_corpus=None,
                     name=None,
                     **kwargs):
        """
        Create model.

        Uploads Translation Memory eXchange (TMX) files to customize a translation model.
        You can either customize a model with a forced glossary or with a corpus that
        contains parallel sentences. To create a model that is customized with a parallel
        corpus <b>and</b> a forced glossary, proceed in two steps: customize with a
        parallel corpus first and then customize the resulting model with a glossary.
        Depending on the type of customization and the size of the uploaded corpora,
        training can range from minutes for a glossary to several hours for a large
        parallel corpus. You can upload a single forced glossary file and this file must
        be less than <b>10 MB</b>. You can upload multiple parallel corpora tmx files. The
        cumulative file size of all uploaded files is limited to <b>250 MB</b>. To
        successfully train with a parallel corpus you must have at least <b>5,000 parallel
        sentences</b> in your corpus.
        You can have a <b>maxium of 10 custom models per language pair</b>.

        :param str base_model_id: The model ID of the model to use as the base for
        customization. To see available models, use the `List models` method. Usually all
        IBM provided models are customizable. In addition, all your models that have been
        created via parallel corpus customization, can be further customized with a forced
        glossary.
        :param file forced_glossary: A TMX file with your customizations. The
        customizations in the file completely overwrite the domain translaton data,
        including high frequency or high confidence phrase translations. You can upload
        only one glossary with a file size less than 10 MB per call. A forced glossary
        should contain single words or short phrases.
        :param file parallel_corpus: A TMX file with parallel sentences for source and
        target language. You can upload multiple parallel_corpus files in one request. All
        uploaded parallel_corpus files combined, your parallel corpus must contain at
        least 5,000 parallel sentences to train successfully.
        :param str name: An optional model name that you can use to identify the model.
        Valid characters are letters, numbers, dashes, underscores, spaces and
        apostrophes. The maximum length is 32 characters.
        :param dict headers: A `dict` containing the request headers
        :return: A `DetailedResponse` containing the result, headers and HTTP status code.
        :rtype: DetailedResponse
        """

        if base_model_id is None:
            raise ValueError('base_model_id must be provided')

        headers = {}
        if 'headers' in kwargs:
            headers.update(kwargs.get('headers'))
        sdk_headers = get_sdk_headers('language_translator', 'V3',
                                      'create_model')
        headers.update(sdk_headers)

        params = {
            'version': self.version,
            'base_model_id': base_model_id,
            'name': name
        }

        form_data = {}
        if forced_glossary:
            form_data['forced_glossary'] = (None, forced_glossary,
                                            'application/octet-stream')
        if parallel_corpus:
            form_data['parallel_corpus'] = (None, parallel_corpus,
                                            'application/octet-stream')

        url = '/v3/models'
        response = self.request(
            method='POST',
            url=url,
            headers=headers,
            params=params,
            files=form_data,
            accept_json=True)
        return response