Bulk Edit for annotation set in alexa ASR not working - alexa

I am interested in using the annotation set feature that is part of model evaluation in the Alexa developer console. Currently, I am able to import in the zip file containing all the mp3 files, however the "Expected Transcription" for each mp3 file is not filled in. According to https://developer.amazon.com/en-US/docs/alexa/asr/create-annotation-set.html#metadata, I can use the bulk edit feature to fill in each file's metadata at once instead of doing it one at a time. However, when I try to import the bulk edit file (I have tried both CSV and JSON) the mp3 file does not get the "Expected Transcription" line filled in. Instead a new annotation is created where the mp3 file is then missing. I have included a picture below for better reference. I have tried uploading the bulk edit first and then the mp3 files but that does not give me better results.
What the annotation set on ASR in developer console looks like:

Related

Zip file format for uploading pre-annotated data in Watson Knowledge Studio

I am trying to figure out how to include a pre-annotated model in Watson Knowledge Studio. I have followed the information found here but it doesn't seem to generalize. As a start I have tried exporting an annotated set from Knowledge Studio to re-upload (using the "Import corpus documents and include ground truth" option). If I re-upload the exported zip as-is this works but if I unzip the folder and then recompress it I get the following error:
A file could not be imported: The imported ZIP file is not in the expected format. Check whether the file was exported from another project. The type system from the same project must be imported first. (You selected 'Import corpus documents and include ground truth').
I have tried using the zip command in Linux (both with and without the -k flag which tries to force to MS-DOS style naming) and also used the compress utility in Windows but I get the same error each time. This is without making any changes to the contents of the folder.
Any help would be greatly appreciated!
Would you please check internal structure of your created ZIP with comparing the original ZIP ? Sometime I got the similar trouble report and found that their created ZIP contains root folder in ZIP structure. WKS expects the same folder structure in the ZIP file.

Data Extraction from PDF

I get 15+ PDF's a day that I have to enter into a database. They are generated from a table where the "Blanks" are filled in from specific table fields. Any tools or python code examples I could use to try and develop a means of extracting the data from the PDF to either write to or create a table to import to the database table? The Database is currently Access mdb.
Thanks
There are a number of approaches that will work.
One simple approach is to simply print the PDF file out to a text file and then have Access import that text. All recent versions of windows allow you to install a “text” printer that outputs the printing of a document to a text file. You can have access “process” a folder of pdfs, print them to text and then import those text files. You might need some VBA to remove “pages” and some extra lines before you import the data into Access.
Another approach is to use Word (Automate from Access) to open a PDF. When word opens a pdf, it converts it to a word document. This approach will even format rows as a word table. You can then pluck out that table data and send that data to word. You can likely pull that text out without writing the data out to a text file – or just use Words “save-as” to a text file (you can automate this process from Access).
Another approach is to use the free Ghost Script library that can extract text from a PDF (this I would consider if did not have word at your disposal).
So which solution is best will much depend on the current software you going to have installed on the computer running Access. Opening the pdf files with word would be my first choice and test.
At my old job we used Cogniview which converted PDF to Excel spreadsheets quite quickly. If you want to use Python, a quick search yielded me this which seems straight forward enough, PDF to XLS with Python

File Maker Scripting - Sending Different Attachment

Is there a way to send a mail with different PDF file to different contacts using file maker?
I am aware of sending batch emails with one attachment but I would like to send a personalize PDF for each contact which seems not so simple.
Also
Can I add PDF files to the table itself or would I have to use the path to the file?
Example:
Table 1
**Name** [James Brown] [James Blue]
**Email** [brown.j#gmail.com] [blue.j#gmail.com]
**PDFfileAttchamnet** [folder/PDF/JamesBrown.pdf] [folder/PDF/JamesBlue.pdf]
So an Email for James Brown would look like:
Dear James Brown, please see the attached file.
Attachment [JamesBrown.pdf] {actual file}
and
Dear James Blue, please see the attached file.
Attachment [JamesBlue.pdf] {actual file}
I think you can solve it by creating container field in you database and import the pdfs in it.
then you can use export Field Contents[] to export it and send it by email
Hope it useful
I would like to send a personalize PDF for each contact which seems
not so simple.
Find the records of contacts you want to include and loop among them, sending mail to each one individually (i.e. without selecting the 'Collect addresses across found set' option).
Can I add PDF files to the table itself or would I have to use the
path to the file?
You can do either, it's up to you. If the path to the file can be calculated (as in your example), you can calculate it right there in the Send Mail script step.
Note that you can also generate the PDF files during the process itself.
Do I understand correctly that you would actually like to personalize the PDF document(s)?
This is possible, maybe not very simple, but quite simple. The trick is to prepare the PDF as a form, and then fill the form fields to personalize.
PDF has a native forms data format (called FDF), which is described in ISO 32000 (as well as the older PDF specification documents provided by Adobe, as you can find in the Acrobat SDK, downloadable from the Adobe website).
FDF is a simple structured text file, which can easily be assembled using FileMaker (I have done that routinely for several catalog projects). The easiest way to get going is to open the form in Acrobat, fill in the fields, and then export the data as FDF. This gives you the pattern to "fill in the blanks".
So, you create the FDF files using Filemaker. With them you can fill the blank form and feed the saved document to the eMail system.
Which tool to use to fill the blank form depends on the volume you have to process. Acrobat is not very powerful (and you may end up in a bit of a legal gray zone, because Acrobat is not set up for being used as a service). There are applications which are made specifically for filling out forms on a server (such as FDFMerge by Appligent), or there are also several libraries which have the tools to fill out forms (iText or pdflib come to my mind). These applications also allow you to flatten the PDF, which means that there are no longer form fields, but their contents becomes part of the base.
The resulting file can now be either made to an eMail attachment, or you make it available on a server and send an eMail with the link to the file (which method you will use may depend on security and privacy regulations).

RTF blob to file via SQL Server

We are importing a source database X to our target database Y.
X has blobs of text in RTF format which are somehow displayed in its application.
Our web app can't display RTF, so we were instructed to convert those blobs of RTF into files in our database Y.
We simply copy the RTF blob from X, where it is nvarchar, into a column in Y which we already use for storing attachments, which is of type varbinary. Then we write it out as a file foo.rtf when the user wants to view it - so they can download and open the RTF in Word.
Unfortunately the foo.rtf file, when opened in Word, just looks like raw RTF, Something like
{\rtf1\ansi\ansicpg1252\deff0\deftab1134{\fonttbl{....
What do we need to do in order to correctly convert this RTF "blob of text" into an actual RTF file? It looks like just saving the bytes doesn't work.
Thank you.
Did you save the file using the extension .rtf -- I know Word opens RTF files just fine that way (assuming the rtf is valid of course)?
ADDED
Something else is wrong then, I did a web site where I generated .RTF file with a few thousand users, with a low level of sophistication -- not a single complaint about problems opening them in word
ADDED MORE
Be sure that you check that the web server is serving up the correct MIME doc type for your files (if rendered in the browser). IIS, APache, etc. do this in different ways
It turns out the source and target encodings were different.
We used Cast(Cast(Value as Varchar(max)) as Varbinary) and that made everything work.

How to retrieve contents from a uploaded file

I am using cakephp framework. I would like to retrieve the contents of the uploaded file and store it in the database. I want to be able to search the content of the uploaded file.
I was made aware that file_get_contents would work for plain .txt files. But all my documents are .docx and .pdfs. Is there any solution I could use.
I appreciate any help.
Thanks
A quick google search got me this:
http://davidwalsh.name/read-pdf-doc-file-php
It appears you can search those files but it requires some additional packages.

Resources