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
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
$account = @{ | |
"username" = "****" | |
"password" = "****" | |
} | |
$texts = @("ColorfulのSSDめっちゃヤバいwww Galaxy S6や廃棄品のSSDから剥がしたフラッシュやIntelの偽物が搭載されているのが確認されてるらしいwww 安価なNVMe CN600もリマークチップを使ってるとのこと、、、 最近めっちゃ秋葉原で売ってるけど買わない方が良さそうだな、、、") | |
$endPoint = "https://gateway.watsonplatform.net/natural-language-understanding/api/v1/analyze?version=2018-03-16" | |
$pass = ConvertTo-SecureString $account.password -AsPlainText -Force | |
$user = $account.username |
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
$apiKey = "****" | |
$texts = @("ColorfulのSSDめっちゃヤバいwww Galaxy S6や廃棄品のSSDから剥がしたフラッシュやIntelの偽物が搭載されているのが確認されてるらしいwww 安価なNVMe CN600もリマークチップを使ってるとのこと、、、 最近めっちゃ秋葉原で売ってるけど買わない方が良さそうだな、、、") | |
$headers = @{ 'Ocp-Apim-Subscription-Key' = $apiKey } | |
$endPoint = "https://eastasia.api.cognitive.microsoft.com/text/analytics/v2.0/sentiment" | |
$texts | ForEach-Object { | |
$text = $_ | |
$obj = @{ | |
documents = @(@{ | |
language = "ja" |