API

Slot Value Extraction API

2018/04/24

Overview: Slot Value Extraction API

Slot Value Extraction API extracts values of predefined slots(*) from an input Japanese text. The slot means attribute information necessary for executing some kind of task. For example, in the task of extracting a full name, when a Japanese text “名前は田中太郎です” is given, then it extracts “田中” as a surname and “太郎” as a given name. In addition to extracting the character strings included in the input text as is, normalized values can also be extracted at the same time, so you can easily use the extracted values.

By using the API, you can develop a chatbot that responds to names or birthdays, and a system that automatically identifies a customer on behalf of an operator by combining it with a voice recognition system. Of course, there are many other use cases.

(*) Six slots such as name (surname and given name), birthday, sex, address, tel (telephone number), and age are predefined.

API URL

https://labs.goo.ne.jp/api/slot

Request parameters

Acceptable POST requests: application/x-www-form-urlencoded or application/json
※ Please be note that GET requests are not acceptable.

Parameter name Explanation
app_id (Required) Application ID
request_id Request ID
If omitted, then request_id is assumed to be "labs.goo.ne.jp[TAB]request timestamp[TAB]consecutive number".
sentence (Required) Japanese string to extract
slot_filter Slot filter
Specify the slots to extract as a string separated by “|”.
e.g. “name|birthday”
If omitted, then all slots are extracted.

Response parameters

API response body: JSON format
API content-type: application/json; charset=UTF-8

Parameter name Explanation
request_id Same value as request
slot_filter Same value as request
slots Object that has slots specified in slot_filter as keys. If a slot value can not be extracted, the key exists but the value is an empty array.
name Slot of full name
e.g. {"surname":"山田","given_name":"太郎"}
surname Surname in name
given_name Given name in name
birthday Slot of birthday
e.g. {"value":"大正10年1月1日","norm_value":"1921-01-01"}
value Birthday string as is
AD or Japanese calendar is valid.
norm_value YYYY-MM-DD formatted value
If value can not be normalized, or exceed the range of valid age, then norm_value be null.
sex Slot of sex
e.g. {"value":"男","norm_value":"男性"}
value Sex string as is
norm_value Normalized value that will be “男性” or “女性”.
address Slot of address
e.g. {"value":"東京都港区芝浦3丁目4ー1","norm_value":"東京都港区芝浦三丁目4-1","lat":35.643462,"lon":139.746042}
value Address string as is
norm_value Normalized value that contains prefecture name.
lat latitude
Only provided if norm_value is extracted.
lon longitude
Only provided if norm_value is extracted.
tel Slot of telephone number
e.g. {"value":"(090)0000-1111","norm_value":"09000001111"}
value Telephone number as is
10-digit or 11-digit telephone number in Japan is valid.
norm_value Normalized value as a string of numbers.
age Slot of age
e.g. {"value":"三十路","norm_value":30}
value Age string as is
norm_value Normalized value as a number.
Valid range is [0, 125].
If value can not be normalized, or exceed the range of valid age, then norm_value be null.
If birthday is specified and birthday.norm_value is extracted, then age.norm_value be calculated age from the birthday and age.value be null.

Input/Output sample

Input sample (application/json)

{"app_id":"[app_id]", "request_id":"record008", "sentence":"名前は田中太郎で、男性で、30歳です。港区芝浦3-4-1に住んでいます。"}

:Output sample

{"request_id":"record008","slots":{"name":[{"surname":"田中","given_name":"太郎"}],"sex":[{"value":"男性","norm_value":"男性"}],"address":[{"value":"港区芝浦3-4-1","norm_value":"東京都港区芝浦三丁目4-1","lat":35.643462,"lon":139.746042}],"tel":[],"age":[{"value":"30歳","norm_value":30}],"birthday":[]}}

Click here to get more information about using APIs in goo Labs.
Please click here to register.

APIコンソール

開く

Japanese Analysis API

Japanese Morphological Analysis API
Japanese Named Entity Extraction API
Japanese Word Similarity API
Japanese Hiragana Conversion API
Product Review Summarization API
Japanese Keyword Extraction API
Slot Value Extraction API