Skip to content
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

Feature/kasr 2098 #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
recog_config = {
"Verify-Buffer-Utterance": False,
"Media-Type": None,
"loggingTag": None,
}


Expand Down
38 changes: 25 additions & 13 deletions cpqdasr/recognizer/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,30 @@ def __init__(self, speech_segment_index, text):
self.speechSegmentIndex = speech_segment_index
self.text = text

def __repr__(self) -> str:
return str(vars(self))


class AgeResponse:
def __init__(
self, event=None, age=None, confidence=None, p=None
):
def __init__(self, event=None, age=None, confidence=None, p=None):
self.age = age
self.event = event
self.confidence = confidence
self.p = p

def __repr__(self) -> str:
return str(vars(self))


class GenderResponse:
def __init__(self, event=None, p=None, gender=None):
self.event = event
self.gender = gender
self.p = p

def __repr__(self) -> str:
return str(vars(self))


class EmotionResponse:
def __init__(self, p=None, event=None, emotion=None, p_groups=None):
Expand All @@ -53,20 +60,22 @@ def __init__(self, p=None, event=None, emotion=None, p_groups=None):
self.p = p
self.p_groups = p_groups

def __repr__(self) -> str:
return str(vars(self))


class RecognitionResult:
def __init__(
self,
result_code,
speech_segment_index,
last_speech_segment,
sentence_start_time_milliseconds,
sentence_end_time_milliseconds,
alternatives,
age_scores=None,
gender_scores=None,
emotion_scores=None,
self,
result_code,
speech_segment_index,
last_speech_segment,
sentence_start_time_milliseconds,
sentence_end_time_milliseconds,
alternatives,
age_scores=None,
gender_scores=None,
emotion_scores=None,
):
assert type(result_code) is str
assert type(speech_segment_index) is int
Expand All @@ -83,3 +92,6 @@ def __init__(
self.age_scores = age_scores
self.gender_scores = gender_scores
self.emotion_scores = emotion_scores

def __repr__(self) -> str:
return str(vars(self))