Creating a Word Dictionary
Function
This API is used to create a Poisson word dictionary. The name of the Poisson word dictionary can be used in the following configuration items of Poisson Analyzer: poisson_synonyms_dict_paths, poisson_dict_paths, and poisson_stopword_dict_paths.
URI
POST /v1.0/{project_id}/clusters/{cluster_id}/poisson_words
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. For details, see Obtaining the Project ID and Account ID. |
|
cluster_id |
Yes |
String |
ID of the cluster where custom word dictionaries are to be configured. |
Request
Table 2 describes the request parameters.
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
Yes |
String |
Name of the word dictionary. The name can be used as the value of any of the following configuration items of Poisson Analyzer: poisson_synonyms_dict_paths, poisson_dict_paths, and poisson_stopword_dict_paths. |
|
wordType |
Yes |
String |
Type of the word dictionary. Currently, the following three types are supported:
|
|
words |
Yes |
Array of strings |
Content of the word dictionary. A main word or stop word is considered as a string, while a group of synonyms is considered as a string. |
|
strategy |
No |
String |
Available options are create and append. The default value is create, indicating to add words to the existing word dictionary. Value append indicates to append words to the existing word dictionary. |
Response
None
Examples
Example request
POST /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters/ea244205-d641-45d9-9dcb-ab2236bcd07e/poisson_words
{
"name":"main.txt",
"wordType":"MainWord",
"words":["Keyword-1","Keyword-2"],
"strategy":"create"
}
Status Code
Table 3 describes the status code.
Last Article: Poisson Word Segmentation (Version 6.2.3)
Next Article: Querying the Word Dictionary Status
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.