IBM Watson Text-to-Speech pronounces sentence-ending point after custom word - text-to-speech

I'm using the WDC Text-to-Speech service, and have the below case:
I'm using a customized model, based on fr-FR_ReneeVoice, to customize the way some words are pronounced. One of the words is "ONT", which is translated to
<phoneme alphabet="ibm" ph=".o.En.te"></phoneme>
When this word occurrs at the end of a sentence (such as "Trouvez votre ONT."), the TTS service explicitly pronounces the sentence-ending dot (such as "Trouvez votre ONT point"). If I remove this dot, it messes up the pronunciation of the next sentence, as there is no sentence break.
How should this be handled? The documentation does not mention any limitations or ways to handle this.

I tried the same case and cannot replicate the issue that you see. Can you run this curl command and report back what you see for the translation for the word ONT?
curl -k -u username:password -X GET "https://stream.watsonplatform.net/text-to-speech/api/v1/customizations/customID?alphabet=spr"
I get the following:
"words": [{
"translation": "`[.2o.0En.t1e]",
"word": "ONT"
}],
In above curl command, replace with your username, password and customization ID.
Thanks,
Tony

Related

How can I remove the last three pages of a set of PDF files using pdf-stapler?

I have a large set of PDF files, each of which contains three unnecessary pages at the end. I was originally trying to create a solution based on an answer I found on askUbuntu and another StackOverflow question, but pdf-stapler apparently doesn't support the "r" notation that pdftk did, e.g. if I try pdf-stapler del myFile.pdf r4-r1 outputFiles/myFile.pdf or pdf-stapler cat myFile.pdf 1-r4 outputFiles/myFile.pdf, I get an error saying "Invalid range: r4-r1" for the first option and an output file with only page 1 for the second option.
Is there a way to do this with pdf-stapler?
The qpdf CLI command should be available in the Fedora repositories. It supports the "r" notation, so removing the last three pages from a file should work like this:
qpdf --pages myFile.pdf 1-r4 -- myFile.pdf outputFiles/myFile.pdf

Pocketspinx, russian language and keywordspotting

The goal is:
Control smart house via predefined text commands. Without any activation word like okay google, it always listening.
What's done:
pocketsphinx_continuous -inmic yes -hmm /path/zero_ru.cd_cont_4000 -dict /path/my_dictionary_out -lm /path/lmbase.lm.DMP
Where my_dictionary_out has using words one by one. And it works, but I think KWS mode might be better. So I've written a text file like:
включи свет комнате /1e-50/
выключи свет комнате /1e-50/
and trying to run sphinx without language model (-lm option), but got nothing. It doesn't recognize commands from keywords file.
What's wrong?

With syslog-ng how do you embed regex's in templates

I am converting a rsyslog template to syslog-ng and I cannot find in the syslog-ng docs how to embed regex's in a template. The incoming message body looks like this:
123 1.2.3.4 4.3.2.1:80 someone#somewhere.com US
The original rsyslog template is:
$template graylog_json,"{\"version\":\"1.1\", \"host\":\"%HOSTNAME:::json%\", \"short_message\":\"Mail Authentication Log\", \"_LogDateTime\":\"%timereported:::date-rfc3339,json%\", \"_Cluster\":\"c25\", \"_ResponseCode\":\"%msg:R,ERE,1,BLANK:^[^ ]*? ([0-9]{3}) --end:json%\", \"_SourceIP\":\"%msg:R,ERE,2,BLANK:^ ([0-9]{3}) ([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})--end:json%\", \"_DestinationIP\":\"%msg:R,ERE,1,BLANK: ([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}):[0-9]{2,4}--end:json%\", \"_DestinationPort\":\"%msg:R,ERE,1,BLANK: [0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}:([0-9]{2,4})--end:json%\", \"_UserAccount\":\"%msg:R,ERE,1,BLANK::[0-9]{2,4} ([^ ]{1,})--end:json%\", \"_Country\":\"%msg:R,ERE,2,BLANK::[0-9]{2,4} ([^ ]{1,})( [A-Z?]{2})?--end:json%\"}\n"
The regex bits in the template parse out the relevant fields in the original message. I can't just dump messages to graylog because we use custom fields. I believe I want to use a template in syslog-ng, but I can't find examples, or even docs, showing how to embed regex's inside a template.
looking at the body of your message, you have the following options:
Parse the message with a csv-parser, using the whitespace as separator character. Note that the csv-parser will not split the IP:port, but you can run another csv-parser on the address (this time with : as separator) to do that. You can find examples for that in the syslog-ng documentation
Alternatively, you can write a custom syslog-ng parser in Python to process this message, and use the standard python string functions to separate the message into words and split the IP:port pair.
Using the csv-parser is probably easier and has better performance.
Also, syslog-ng version 3.13 includes a graylog destination (that's not included in the docs yet, but you can find an example in this blog post Graylog as destination in syslog-ng)

Translation from plain English to a set of instruction

I have a set of instructions, for example Linux's "ls", "grep", "cd", etc.
I want the user to be able to execute this commands without knowing the exact names and parameters but rather with something similar to their meaning in plain English, e.g. "show me all folders", "filter all files by name" , "go to directory". Or in other words: the user input is "Show me all files and then show me all that contains 'foo' " to be translated to "ls | grep foo"
I understand that I will need some kind of meta-information about each instruction and do some kind of evaluation how close is the user query term to each instruction. Something like:
<instruction>
<command>ls</command>
<semantic>lists all files</semantic>
<plainEnglish>List all the files in this directory</plainEnglish>
<synonyms>
<synonym>Show all files</synonym>
...etc
</synonyms>
</instruction>
So which is the important information and how to do this evaluation?
Any general guidelines how I can translate the user's input to a specific instruction from my set? (This sounds like quite a challenge to me)

How do I add a heroku deployhook:email using API?

I have been able to add a deployhook (for email and IRC) using the heroku cli (sdk). I would like to be able to add or update the email values (receipient etc) using the API. Is this possible? When I try to curl request to add a hook I get an error message noting the need for extra data: receipient, body, etc.
You can find a bit more detail about the different arguments here: https://devcenter.heroku.com/articles/deploy-hooks#email
Once you know what values you want/need you should be able to send it using this:
curl -n -g -X POST 'https://api.heroku.com/apps/MYAPP/addons/deployhooks%3Aemail?config[recipient]=me#example.com&config[subject]="MYAPP%20Deployed"&config[body]="{{user}}%20deployed%20app"'
The arguments:
-n reads credentials from netrc (this should be set by the toolbelt/cli)
-g tells it to not try and interpret the [] and {} in the url
-X POST sets it to be a POST rather than get request
Beyond that it was just a matter of encoding the params properly. I believe of those values recipient is the only required value (and the others have reasonable defaults).
You can only have one deployhook per type and they don't appear to allow updates. So if you need to change it, you'll want to remove the old one and then add another with the updated attributes. You can remove the old one like this:
curl -n -X DELETE 'https://api.heroku.com/apps/MYAPP/addons/deployhooks%3Aemail'