Open
Conversation
Member
|
Is this ready to review? |
813b0dd to
c121a52
Compare
Collaborator
Author
Yes! |
RiscadoA
requested changes
May 24, 2023
Comment on lines
+45
to
+51
| with ZipFile("../data/vosk-model-small-en-us-0.15.zip", 'r') as zObject: | ||
|
|
||
| # Extracting the zip | ||
| zObject.extractall(path="../data") | ||
|
|
||
| # Delete the zip file | ||
| os.remove("../data/vosk-model-small-en-us-0.15.zip") |
Member
There was a problem hiding this comment.
I think it would be better to generalize this and move it inside the for above it.
Check if the file extension is .zip, in which case you extract it and delete the .zip file.
Comment on lines
+54
to
+63
| def install_packages(): | ||
| """Install the required python libraries.""" | ||
|
|
||
| for package in PACKAGES: | ||
| print("Downloading python library {}...".format(package)) | ||
| try: | ||
| subprocess.check_call([sys.executable, "-m", "pip", "install", package], stdout=subprocess.DEVNULL) | ||
| except Exception as e: | ||
| print("Failed to download library {}".format(package)) | ||
| print("Exception {}".format(e)) |
Member
There was a problem hiding this comment.
Installing python packages is not so straight forward on my distro, I would prefer us adding a requirements.txt with the necessary packages and just install them with pip.
Comment on lines
+19
to
+20
| def emotionFromPhrase(self): | ||
| # TODO: implement this |
Member
There was a problem hiding this comment.
Shouldn't this be within nlp.py?
| def __init__(self, phrase) -> None: | ||
| self.phrase = phrase | ||
|
|
||
| def setPhrase(self, phrase): |
| self.phrase = phrase | ||
|
|
||
| def setPhrase(self, phrase): | ||
| self.phrase = self |
Member
There was a problem hiding this comment.
Suggested change
| self.phrase = self | |
| self.phrase = phrase |
| def setPhrase(self, phrase): | ||
| self.phrase = self | ||
|
|
||
| def getPhrase(self): |
Comment on lines
+34
to
+42
| while True: | ||
| try: | ||
| data = self.stream.read(4096) | ||
| if self.recognizer.AcceptWaveform(data): | ||
| res = json.loads(self.recognizer.Result()) | ||
| phrase = res["text"] | ||
| print(phrase) | ||
| except KeyboardInterrupt: | ||
| break |
Member
There was a problem hiding this comment.
Any ideas on how to integrate it with the rest of the code?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.