new LanguageTranslatorV2()
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
params.url |
string |
<optional> |
https://gateway.watsonplatform.net/language-translation/api | The service URL. |
params.username |
string | Username |
||
params.password |
string | Password |
- Source:
Methods
createModel()
Creates a translation model
Parameters:
| Name | Type | Description |
|---|---|---|
params.base_model_id |
string | The base model identifier |
params.name |
string | The model name |
params.forced_glossary |
stream | A UTF-8 encoded TMX file that contains pairs of matching terms in the source and target language that are seen as absolute by the system. This file completely overwrites the original domain data. |
params.parallel_corpus |
stream | A UTF-8 encoded TMX file that contains matching phrases in the source and target language that serve as examples for Watson. Parallel corpora differ from glossaries because they do not overwrite the original domain data. |
params.monolingual_corpus |
stream | A UTF-8 encoded plain text file that contains a body of text in the target language that is related to what you are translating. A monolingual corpus helps improve literal translations to be more fluent and human. |
- Source:
deleteModel()
Deletes a model
Parameters:
| Name | Type | Description |
|---|---|---|
params.model_id |
string | The model identifier |
- Source:
getIdentifiableLanguages()
Returns the identifiable languages
- Source:
getModel()
Return the translation model
Parameters:
| Name | Type | Description |
|---|---|---|
params.model_id |
string | The model identifier |
- Source:
getModels()
Return the translation models
Parameters:
| Name | Type | Description |
|---|---|---|
params.default |
string | Query filters to check if the model is the default one used when only source and target languages are specified. |
params.source |
string | Filter by source language |
params.target |
string | Filter by target language |
- Source:
identify()
Identify the text based on the identifiable languages
Parameters:
| Name | Type | Description |
|---|---|---|
params.text |
string | text to identify |
- Source:
translate()
Translate pharagraphs from one language into another
Parameters:
| Name | Type | Description |
|---|---|---|
params.source |
string | Source language |
params.target |
string | Target language |
- Source: