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

Add SentenceInfo.msg and WordInfo.msg #28

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
2 changes: 2 additions & 0 deletions speech_recognition_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ add_message_files(
FILES
Grammar.msg
PhraseRule.msg
SentenceInfo.msg
SpeechRecognitionCandidates.msg
Vocabulary.msg
WordInfo.msg
)

add_service_files(
Expand Down
2 changes: 2 additions & 0 deletions speech_recognition_msgs/msg/SentenceInfo.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Header header

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What kind of use are you planning for header of SentenceInfo.msg?

speech_recognition_msgs/WordInfo[] words
3 changes: 2 additions & 1 deletion speech_recognition_msgs/msg/SpeechRecognitionCandidates.msg
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
string[] transcript # candidate words of speech-to-text API
float32[] confidence # confidence of transcript
float32[] confidence # confidence of transcript
speech_recognition_msgs/SentenceInfo[] sentences # contains the beginning and ending times of each word.
7 changes: 7 additions & 0 deletions speech_recognition_msgs/msg/WordInfo.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# please see below URL for more details.
# https://cloud.google.com/speech-to-text/docs/reference/rest/v1/speech/recognize#wordinfo
float64 start_time
float64 end_time
Copy link

@sktometometo sktometometo Apr 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

startTime and endTime of original WordInfo are Duration (formatted string). I think duration is more compatible to it than float64.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

start_time is duration from the initial time of sentences to the start of the word. This is not clear from the field name itself.

Please add field description or change field name in order to make target use of each field clear to users.

string word
float64 confidence
int32 speaker_tag