Ich benutze Microsoft Congnitive WebLM, um Wörter zu brechen, und es gibt die gesamte cURL Anfrage aus, und ich kann nicht herausfinden, wie man die Ergebnisse verwendet.cURL Ausgabe der gesamten Antwort
Der Code, den ich verwende:
$word = 'iwansttobreakfree';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,
"https://api.projectoxford.ai/text/weblm/v1.0/breakIntoWords?model=query&text=" . $word);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, "");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Ocp-Apim-Subscription-Key: [subscription key removed for stack overflow]"
));
$result = curl_exec($ch);
curl_close($ch);
var_dump($result);
Das Ergebnis ist, dass ich immer sind
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 320
Content-Type: application/json; charset=utf-8
Expires: -1
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
apim-request-id: ef73d48d-ab35-4fa5-a346-c57339415824
Date: Thu, 21 Jul 2016 20:00:12 GMT
{"candidates":[{"words":"i want to break free","probability":-7.1759999999999993},{"words":"iwant to break free","probability":-9.1660000000000021},{"words":"i want to breakfree","probability":-9.547},{"words":"i wan t to break free","probability":-9.8390000000000022},{"words":"iwanttobreakfree","probability":-9.877}]}
--------
bool(true)
Weiß jemand, wie ich die Ergebnisse json verwenden können, mit sich die ganze Ausgabe von cURL Antwort?
lol, ich denke, es ist einer von denen, 'Code block' Augenblick war, nachdem ein Gebräu mit klar war, :) –
passiert mir die ganze Zeit. –