Test a model
After model training is complete, you can find the model in the Model Hub. You can test the model after you publish it.
You can use the model testing interface to enter text and test the model on the platform. The NLP Self-Learning Platform also supports invoking the model using an API or an SDK. For more information, see GetPredictResult.
Input format example
Input text
[
["1My Jiebei credit limit", "What is my Jiebei credit limit"],
["2My Jiebei credit limit", "What is my Jiebei credit limit"],
["3My Jiebei credit limit", "What is my Jiebei credit limit"]
]Because the input must be a JSON string, format the input text object as JSON. The following is a Python example:
pair = [
["1My Jiebei credit limit", "What is my Jiebei credit limit"],
["2My Jiebei credit limit", "What is my Jiebei credit limit"],
["3My Jiebei credit limit", "What is my Jiebei credit limit"],
]
content = json.dumps(pair)The input can contain multiple sentence pairs, and the API returns a similarity result for each pair. Include fewer than five sentence pairs in each request. If you include more, the model prediction time increases, which may cause a timeout error. A request that contains multiple sentence pairs is billed only once.
Sample response
[
{
"match": "0",
"sent_a": "1My Jiebei credit limit",
"sent_b": "What is my Jiebei credit limit",
"value": "0.49516323"
},
{
"match": "0",
"sent_a": "2My Jiebei credit limit",
"sent_b": "What is my Jiebei credit limit",
"value": "0.49403203"
},
{
"match": "0",
"sent_a": "3My Jiebei credit limit",
"sent_b": "What is my Jiebei credit limit",
"value": "0.48574427"
}
]Field descriptions
Field name | Description |
match | "0" indicates no match. "1" indicates a match. |
sent_a | The first sentence. |
sent_b | The second sentence. |
value | A probability value between 0 and 1. This value indicates the confidence level of the match. |