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

Speech analysis framework #1189

Open
ybyzek opened this issue Mar 21, 2022 · 0 comments
Open

Speech analysis framework #1189

ybyzek opened this issue Mar 21, 2022 · 0 comments
Labels
recipe use case A tutorial with an extended business use case

Comments

@ybyzek
Copy link
Contributor

ybyzek commented Mar 21, 2022

Part of a data pipeline workflow to display analytics of the transcribed audio files.

Sample select statements to convey the type of analysis you can do with transcripts (this code sample is not ksql-ready, it needs to be adapted):

-- Order Natural Language Entities for all records
SELECT
  *
FROM (
  SELECT
    entities.name,
    entities.type,
    COUNT(entities.name) AS count
  FROM
    `[YOUR_PROJECT_ID].[YOUR_DATASET].[YOUR_TABLE]`,
    UNNEST(entities) entities
  GROUP BY
    entities.name,
    entities.type
  ORDER BY
    count DESC )
-- List word, start time, end time, speaker tag and confidence for all records
SELECT
  ARRAY(
  SELECT
    AS STRUCT word,
    startSecs,
    endSecs,
    speakertag,
    confidence
  FROM
    UNNEST(words)) transcript
FROM
  `[YOUR_PROJECT_ID].[YOUR_DATASET].[YOUR_TABLE]`
 -- Search Transcript with a regular expression
SELECT
  transcript,
  fileid,
  callid,
  year,
  month,
  day,
  sentimentscore,
  magnitude,
  date,
  silencesecs
FROM
  `[YOUR_PROJECT_ID].[YOUR_DATASET].[YOUR_TABLE]`
WHERE
  (REGEXP_CONTAINS(transcript, '(?i) [YOUR_WORD]' ))

Inspiration: https://github.com/GoogleCloudPlatform/dataflow-contact-center-speech-analysis

@ybyzek ybyzek added recipe use case A tutorial with an extended business use case labels Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
recipe use case A tutorial with an extended business use case
Projects
None yet
Development

No branches or pull requests

1 participant