ibmtjbot / tjbot

IBM TJBot
https://ibmtjbot.github.io
Apache License 2.0
481 stars 282 forks source link

Transition from Tone Analyzer to Natural Language Understanding #187

Closed LordofSabres closed 2 years ago

LordofSabres commented 2 years ago

@jweisz

Good evening, I am a student who is working on a project regarding the TJBot recognizing tone from speech said by the people around the robot. However, when reading on the IBM website, I found out that the Tone Analyzer service is deprecated and will be erased in February of 2023. I would like to keep use of my project in the future so I intend on moving it to using the Natural Language Understanding. However, I am looking for where the hard code was for the Tone Analyzer Python program based on the docs here:

- https://cloud.ibm.com/apidocs/tone-analyzer?code=python#authentication (The old) - https://cloud.ibm.com/apidocs/natural-language-understanding?code=python#emotion (The new)

`import json from ibm_watson import ToneAnalyzerV3 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator

authenticator = IAMAuthenticator('{apikey}') tone_analyzer = ToneAnalyzerV3( version='2017-09-21', authenticator=authenticator )

tone_analyzer.set_service_url('{url}')

text = 'Team, I know that times are tough! Product '\ 'sales have been disappointing for the past three '\ 'quarters. We have a competitive product, but we '\ 'need to do a better job of selling it!'

tone_analysis = tone_analyzer.tone( {'text': text}, content_type='application/json' ).get_result() print(json.dumps(tone_analysis, indent=2))`

in relation to how the tone analyzer is used in the TJBot sentiment analysis js https://github.com/ibmtjbot/tjbot/blob/master/recipes/sentiment_analysis/sentiment.js

I am hoping to attempt to find a way to switch the TJBot to use Natural Language Understanding instead in the future and would like some help with it from experts such as you guys. This is not really an issue as of now, but I believe this will be a problem in the future and would like to bring it to your attention. I plan on looking into fixing it by hardcoding it but that is why I ask here.

jweisz commented 2 years ago

Hi, sorry for the delayed response, I was out on leave. Please open this issue in the tjbotlib repository (http://github.com/ibmtjbot/tjbotlib) as that is where the shift from Tone Analyzer to NLU would need to take place. That said, I can't guarantee any specific timeframe on implementing it, though I am open to accepting a PR from you if you would like to take a crack.

I'm closing this issue here so we can move it to the other repo. Thanks!