deepgram / deepgram-brain-python Goto Github PK
View Code? Open in Web Editor NEWPython API wrapper for the Deepgram API. Oh yes, it's cool. You should get it.
License: Apache License 2.0
Python API wrapper for the Deepgram API. Oh yes, it's cool. You should get it.
License: Apache License 2.0
from deepgram import Brain
# Get your user_id and token from deepgram.com/console/documentation
brainAPI = Brain(user_id='cxcxcxcxcxcxcxcxcxc', token='xcxcxcxcxcxcxcxcxxc')
audioFileLocation = 'my_thoughts_2017_10_25_nlp_lessons_001.wav'
with open(audioFileLocation, mode='rb') as audioFile:
asset = brainAPI.transcribe(audioFile)
print asset
I getting following error
File "test.py", line 40, in
asset = brainAPI.transcribe(audioFile)
File "C:\Python27\lib\site-packages\deepgram\connection.py", line 138, in tran
scribe
return self.uploadAsset(data, async=False)['transcript']
File "C:\Python27\lib\site-packages\deepgram\connection.py", line 124, in uplo
adAsset
assert isinstance(data, bytes)
AssertionError
please guide ...
`from deepgram import Brain
deepgram_client = Brain(user_id='XXX',token='XXXXX')
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/code.py", line 91, in runcode
exec(code, self.locals)
File "", line 1, in
File "/Users/raja/.venvs/backend/lib/python3.6/site-packages/deepgram/connection.py", line 30, in init
self.login(**kwargs)
File "/Users/raja/.venvs/backend/lib/python3.6/site-packages/deepgram/connection.py", line 64, in login
self.signedUsername = self._checkReturn(requests.get("{}/users/login".format(self.url), auth=auth))[
File "/Users/raja/.venvs/backend/lib/python3.6/site-packages/deepgram/connection.py", line 34, in _checkReturn
value = response.json()
File "/Users/raja/.venvs/backend/lib/python3.6/site-packages/requests/models.py", line 892, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/init.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.