コード例 #1
0
import json
from watson_developer_cloud import ToneAnalyzerV2Experimental

tone_analyzer = ToneAnalyzerV2Experimental(username='******',
                                           password='******')

print(json.dumps(tone_analyzer.scorecards(), indent=2))

print(json.dumps(tone_analyzer.synonyms(word='happy'), indent=2))

print(json.dumps(tone_analyzer.tone(text='Hello how are you?'), indent=2))
コード例 #2
0
import json
from watson_developer_cloud import ToneAnalyzerV2Experimental as ToneAnalyzer

tone_analyzer = ToneAnalyzer(username='******',
                             password='******')

print(json.dumps(tone_analyzer.scorecards(), indent=2))

print(json.dumps(tone_analyzer.synonyms(word='happy'), indent=2))

print(json.dumps(tone_analyzer.tone(text='Hello how are you?'), indent=2))
コード例 #3
0
import json
from watson_developer_cloud import ToneAnalyzerV2Experimental as ToneAnalyzer


tone_analyzer = ToneAnalyzer(username='******',
                             password='******')


print(json.dumps(tone_analyzer.scorecards(), indent=2))

print(json.dumps(tone_analyzer.synonyms(word='happy'), indent=2))

print(json.dumps(tone_analyzer.tone(text='Hello how are you?'), indent=2))
コード例 #4
0
ファイル: server.py プロジェクト: prudhvil/hackingedu
def tone():
    tone_analyzer = ToneAnalyzer(username='',
                             password='')
    cv = request.json['value']
    return json.loads(tone_analyzer.tone(text=cv))