You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/media-services/video-indexer/customize-language-model-with-api.md
+192-2Lines changed: 192 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ You can use the Video Indexer APIs to create and edit custom Language models in
23
23
24
24
## Create a Language model
25
25
26
-
The [create a languate model](https://api-portal.videoindexer.ai/docs/services/Operations/operations/Create-Language-Model?) API creates a new custom Language model in the specified account. You can upload files for the Language model in this call. Alternatively, you can create the Language model here and upload files for the model later by updating the Language model.
26
+
The [create a language model](https://api-portal.videoindexer.ai/docs/services/Operations/operations/Create-Language-Model?) API creates a new custom Language model in the specified account. You can upload files for the Language model in this call. Alternatively, you can create the Language model here and upload files for the model later by updating the Language model.
27
27
28
28
> [!NOTE]
29
29
> You must still train the model with its enabled files for the model to learn the contents of its files. Directions on training a language are in the next section.
@@ -33,19 +33,85 @@ To upload files to be added to the Language model, you must upload files in the
33
33
1. Key will be the file name and value will be the txt file
34
34
2. Key will be the file name and value will be a URL to txt file
35
35
36
+
### Response
37
+
38
+
The response provides metadata on the newly created Language model along with metadata on each of the model's files following the format of the example JSON output.
The [train a language model](https://api-portal.videoindexer.ai/docs/services/operations/operations/Train-Language-Model?&pattern=train) API trains a custom Language model in the specified account with the contents in the files that were uploaded to and enabled in the language model.
39
70
40
71
> [!NOTE]
41
72
> You must first create the Language model and upload its files. You can upload files either when creating the language model or by updating the Language model.
42
73
43
-
A response from the API, returns **id**. You should use the **id** value of the language model for the **linguisticModelId** parameter when [uploading a video to index](https://api-portal.videoindexer.ai/docs/services/operations/operations/Upload-video?) and for the **languageModelId** parameter when [reindexing a video](https://api-portal.videoindexer.ai/docs/services/operations/operations/Re-index-video?).
74
+
### Response
75
+
76
+
The response provides metadata on the newly trained Language model along with metadata on each of the model's files following the format of the example JSON output.
You should use the returned **id** value of the language model for the **linguisticModelId** parameter when [uploading a video to index](https://api-portal.videoindexer.ai/docs/services/operations/operations/Upload-video?) and for the **languageModelId** parameter when [reindexing a video](https://api-portal.videoindexer.ai/docs/services/operations/operations/Re-index-video?).
105
+
44
106
45
107
## Delete a Language model
46
108
47
109
The [delete a language model](https://api-portal.videoindexer.ai/docs/services/operations/operations/Delete-Language-Model?&pattern=delete) API deletes a custom Language model from the specified account. Any video that was using the deleted Language model will keep the same index until you re-index the video. If you re-index the video, you can assign a new Language model to the video. Otherwise, Video Indexer will use its default model to re-index the video.
48
110
111
+
### Response
112
+
113
+
There is no returned content when the Language model is deleted successfully.
114
+
49
115
## Update a Language model
50
116
51
117
The [update a language model](https://api-portal.videoindexer.ai/docs/services/operations/operations/Update-Language-Model?&pattern=update) API updates a custom Language person model in the specified account.
@@ -58,32 +124,152 @@ To upload files to be added to the Language model, you must upload files in the
58
124
1. Key will be the file name and value will be the txt file
59
125
2. Key will be the file name and value will be a URL to txt file
60
126
127
+
128
+
### Response
129
+
130
+
The response provides metadata on the newly trained Language model along with metadata on each of the model's files following the format of the example JSON output.
Use the **id** of the files returned in the response to download the contents of the file.
62
159
63
160
## Update a file from a Language model
64
161
65
162
The [update a file](https://api-portal.videoindexer.ai/docs/services/operations/operations/Update-Language-Model-file?&pattern=update) allows you to update the name and **enable** state of a file in a custom Language model in the specified account.
66
163
164
+
### Response
165
+
166
+
The response provides metadata on the file that you updated following the format of the example JSON output below.
167
+
168
+
```json
169
+
{
170
+
"id": "84fcf1ac-1952-48f3-b372-18f768eedf83",
171
+
"name": "RenamedFile",
172
+
"enable": false,
173
+
"creator": "John Doe",
174
+
"creationTime": "2018-04-27T20:10:10.5233333"
175
+
}
176
+
```
67
177
Use the **id** of the file returned in the response to download the contents of the file.
68
178
69
179
## Get a specific Language model
70
180
71
181
The [get](https://api-portal.videoindexer.ai/docs/services/operations/operations/Get-Language-Model?&pattern=get) API returns information on the specified Language model in the specified account such as language and the files that are in the Language model.
72
182
183
+
### Response
184
+
185
+
The response provides metadata on the specified Language model along with metadata on each of the model's files following the format of the example JSON output below.
Use the **id** of the file returned in the response to download the contents of the file.
74
214
75
215
## Get all the Language models
76
216
77
217
The [get all](https://api-portal.videoindexer.ai/docs/services/operations/operations/Get-Language-Models?&pattern=get) API returns all of the custom Language models in the specified account in a list.
78
218
219
+
### Response
220
+
221
+
The response provides a list of all of the Language models in your account and each of their metadata and files following the format of the example JSON output below.
The [delete](https://api-portal.videoindexer.ai/docs/services/operations/operations/Delete-Language-Model-File?&pattern=delete) API deletes the specified file from the specified Language model in the specified account.
82
262
263
+
### Response
264
+
265
+
There is no returned content when the file is deleted from the Language model successfully.
266
+
83
267
## Get metadata on a file from a Language model
84
268
85
269
The [get metadata of a file](https://api-portal.videoindexer.ai/docs/services/operations/operations/Get-Language-Model-File-Data?&pattern=get%20language%20model) API returns the contents of and metadata on the specified file from the chosen Language model in the your account.
86
270
271
+
### Response
272
+
87
273
The response provides the contents and metadata of the file in JSON format, similar to this:
88
274
89
275
```json
@@ -104,6 +290,10 @@ The response provides the contents and metadata of the file in JSON format, simi
104
290
105
291
The [download a file](https://api-portal.videoindexer.ai/docs/services/operations/operations/Download-Language-Model-File-Content?) API downloads a text file containing the contents of the specified file from the specified Language model in the specified account. This text file should match the contents of the text file that was originally uploaded.
106
292
293
+
### Response
294
+
295
+
The response will be the download of a text file with the contents of the file in the JSON format.
296
+
107
297
## Next steps
108
298
109
299
[Customize Language model using website](customize-language-model-with-website.md)
0 commit comments