This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type requestJson = | |
{ | |
documents: seq<document> | |
} | |
and document = | |
{ | |
language: string | |
id: string | |
text: string | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"documents": [ | |
{ | |
"language": "pl", | |
"id": "32", | |
"text": "ggfdgdfgd" | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let getSentimentScore json = | |
let serializeJson = JsonConvert.SerializeObject json | |
let response = Http.RequestString("https://westus.api.cognitive.microsoft.com/text/analytics/v2.0/sentiment", | |
body = TextRequest serializeJson, | |
headers = [ContentType HttpContentTypes.Json; "Ocp-Apim-Subscription-Key", "api_key"]) | |
response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"documents": [ | |
{ | |
"id": "43", | |
"score": 0.5432 | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type responseJson = | |
{ | |
documents: seq<responseDoc> | |
errors: string list | |
} | |
and responseDoc = | |
{ | |
score: double | |
id: string | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{ | |
"Id": "4", | |
"Text": "bad", | |
"Score": 0.06886895 | |
}, | |
{ | |
"Id": "5", | |
"Text": "very bad", | |
"Score": 0.09467509 | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_type": "SpellCheck", | |
"flaggedTokens": [ | |
{ | |
"offset": 60, | |
"token": "english", | |
"type": "UnknownToken", | |
"suggestions": [ | |
{ | |
"suggestion": "English", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let loadFile path = | |
File.ReadAllText path | |
let getSpellCheck text mode = | |
let response = Http.RequestString(sprintf "https://api.cognitive.microsoft.com/bing/v5.0/spellcheck/?mode=%s" mode, | |
body = TextRequest (sprintf "Text=%s" text), | |
headers = [ContentType "application/x-www-form-urlencoded"; "Ocp-Apim-Subscription-Key", "{api-key}"]) | |
JsonConvert.DeserializeObject<responseJson>(response) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_type": "type", | |
"flaggedTokens": [ | |
{ | |
"offset": 23, | |
"token": "word", | |
"type": "type", | |
"suggestions": [ | |
{ | |
"suggestion": "word1", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type responseJson = | |
{ | |
_type: string | |
flaggedTokens: flaggedToken list | |
} | |
and flaggedToken = | |
{ | |
offset: int | |
token: string | |
``type``: string |
OlderNewer