-
Notifications
You must be signed in to change notification settings - Fork 9
Add emotion text emotion api #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # coding: utf-8 | ||
|
|
||
| """ | ||
| DeepAffects | ||
|
|
||
| OpenAPI spec version: v1 | ||
| """ | ||
|
|
||
|
|
||
| from __future__ import absolute_import | ||
|
|
||
| import os | ||
| import sys | ||
| import unittest | ||
|
|
||
| import deepaffects | ||
| from deepaffects import Audio | ||
| from deepaffects.rest import ApiException | ||
| from deepaffects.apis.diarize_api_v2 import DiarizeApiV2 | ||
| DIR = os.path.dirname(os.path.realpath(__file__)) | ||
| import uuid | ||
|
|
||
|
|
||
| class TestTextEmootion(unittest.TestCase): | ||
|
||
| """ Text Emotion unit test stubs """ | ||
|
|
||
| def setUp(self): | ||
| deepaffects.configuration.api_key['apikey'] = os.environ['DEEPAFFECTS_API_KEY'] | ||
| self.webhook_url = os.environ["DEEPAFFECTS_API_WEBHOOK"] | ||
|
||
| self.api = deepaffects.apis.emotion_api.EmotionApi() | ||
| self.request_id = str(uuid.uuid4()) | ||
|
|
||
| def tearDown(self): | ||
| pass | ||
|
|
||
| def test_async_diarize_audio(self): | ||
|
||
| """ | ||
| Test case for Text Emotion | ||
|
|
||
| Diarize text file | ||
| """ | ||
|
|
||
| body = { | ||
| "content": "Awesome" | ||
| } | ||
| api_response = self.api.sync_text_recognise_emotion(body=body) | ||
| print(api_response) | ||
| assert api_response['response']['trust']> 0.8 | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| unittest.main() | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in file name