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

Validate SSML for Speech #158

Open
szul opened this issue Feb 12, 2020 · 6 comments
Open

Validate SSML for Speech #158

szul opened this issue Feb 12, 2020 · 6 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@szul
Copy link
Contributor

szul commented Feb 12, 2020

Mentioned by @iMicknl in #157--for speech-enabled functionality that accepts SSML, we should validate the data. XSD files can be found at: https://www.w3.org/TR/2009/REC-speech-synthesis-20090303/#AppD

@szul szul added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Feb 12, 2020
@iMicknl
Copy link
Contributor

iMicknl commented Feb 12, 2020

  • Remove all duplicate <speak> </speak> tags
  • Add <speak> </speak> tags if missing
  • Suggest ssml-builder in documentation

@szul
Copy link
Contributor Author

szul commented Feb 12, 2020

@iMicknl Are you looking to validate the SSML or looking to build it without explicitly working with XML? I think we need both as options.

@iMicknl
Copy link
Contributor

iMicknl commented Feb 12, 2020

My main point in #157 was removing the duplicate <speak> tags and wrapping it with <speak> tags if not present. However, good idea to validate the SSML, I am just wondering if this has a performance impact.. So not sure if we should include it by default in the adapters.

@szul
Copy link
Contributor Author

szul commented Feb 12, 2020

We can include the validation as optional and/or tie it to the environment (i.e., on for development; off for production).

Could be a moot point though. Do you know if Alexa does some minor validation on its end? Last I checked the optional SSML in MessageFactory.text() in the Bot Framework didn't require the <speak> tags since you were passing the text using a second parameter. Not sure if Alexa has something similar.

@iMicknl
Copy link
Contributor

iMicknl commented Feb 12, 2020

We can include the validation as optional and/or tie it to the environment (i.e., on for development; off for production).

Possibly we could add SSML validation in a separate helper util, later on? Tying it to environments doesn't make sense for me.

Could be a moot point though. Do you know if Alexa does some minor validation on its end? Last I checked the optional SSML in MessageFactory.text() in the Bot Framework didn't require the <speak> tags since you were passing the text using a second parameter. Not sure if Alexa has something similar.

Amazon does validation server side, which means that they reject your message. Thus the reason that the Alexa adapter is adding tags around the message if you are using activity.speak.

@szul
Copy link
Contributor Author

szul commented Feb 12, 2020

@iMicknl Plenty of applications tie certain functionality to what environment you're running in. For example: Template compilation in the Express framework. ASP.NET Core does a few different things depending on environment too. My point was that if you're concerned about the overhead of validating against an XML Schema, you can either make the validation an optional check via a settings property, or you can explicitly validate in non-production environments, but skip the check in production, if there is any concern about developer overhead with the option setting.

Only validating against the wrapped tags seems like a halfway solution. Do you know what happens if you put invalid tags in outside of the <speak> tag? Does Amazon's validation fail, or does it ignore it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants