Semantic understanding interface


Semantic understanding

1475118416259629.jpg

## WeChat open platform semantic understanding interface call (http request) It is simple and convenient. Users do not need to master semantic understanding and related technologies. They only need to choose the corresponding services according to their own product characteristics to build a set of intelligent semantic services.

Send semantic understanding request

http request method: POST (please Using https protocol)

https://api.weixin.qq.com/semantic/semproxy/search?access_token=YOUR_ACCESS_TOKEN

POST Data format: JSON

POST data example:

{

"query":" Check the China Southern Airlines tickets from Beijing to Shanghai tomorrow.",

"city":"Beijing",

##"category": "flight ,hotel",

"appid":"wxaaaaaaaaaaaaaaaa",

"uid":"123456"

Parameter Description

parameterIs it necessaryParameter typeDescription
access_tokenisStringToken obtained based on appid and appsecret
query is StringInput text string
category is String that needs to be used Service type, multiple separated by ",", cannot be empty
latitudeSee interface protocol documentationFloat Latitude coordinates are input at the same time as longitude; optionally input with city
##longitude See interface protocol documentationFloat The longitude coordinates are input at the same time as the latitude; choose one of the two and input the city
citySee interface protocol documentString City name, choose one of the latitude and longitude
## regionSee the interface protocol documentStringRegion name, if it exists in the city The following can be omitted; choose one of the longitude and latitude and enter
appid is StringThe unique identifier of the public account, used to distinguish the developers of the public account
# #uidNoStringUser unique id (non-development User ID), the user can distinguish different users under the official account (it is recommended to fill in the user openid). If it is empty, the context understanding function cannot be used. The context understanding function can only be used when appid and uid exist at the same time.

Note: The intention of a single category is relatively clear, and the recognition coverage is relatively large. Therefore, if you only want to use a specific category, it is recommended to set the category to only that category.

Return Instructions Under normal circumstances, WeChat will return the following JSON data packet:

{

"errcode":0,

"query":"Check the China Southern Airlines ticket from Beijing to Shanghai tomorrow",

"type":"flight",

"semantic":{

"details":{

“start_loc”:{

“type”:”LOC_CITY”,

“city”:”Beijing ",

## "city_simple":"Beijing",

## "loc_ori":"Beijing"

    },

“end_loc”: {

“type”:”LOC_CITY”,

“city”:”Shanghai City”,

“city_simple” :"Shanghai",

"loc_ori":"Shanghai"

## },

"start_date": {

"type":"DT_ORI",

"date":"2014-03-05",

“date_ori”:”tomorrow”

},

“airline”:”China China Southern Airlines"

},

"intent":"SEARCH"

}

Return parameter description

##NoStringThe results of some categories are displayed in html5, which is currently not supported
parameterIs it necessaryParameter typeExplanation
errcode isInt represents the status after the request
query is String The user’s input string
type is the global type of the String service id, please refer to the vertical service agreement definition in the agreement document
semantic is the structured identifier of Object after semantic understanding. Each service is different
resultNoArray Results for some categories
##answer
##textNoStringSpecial reply instructions

For more details and protocol description, please view: Semantic Understanding Interface Protocol Document