IPS-LMU / EMU-webApp

The EMU-webApp is an online and offline web application for labeling, visualizing and correcting speech and derived speech data.
http://ips-lmu.github.io/EMU-webApp/
MIT License
51 stars 14 forks source link

Validation error for .annotJSON pair #173

Closed mnrao2001 closed 8 years ago

mnrao2001 commented 8 years ago

For checking the import/pair feature, i uploaded the .wav & .TextGrid file pair it worked with out any issues, but when i generated the .annotJSON from the site and then try to import/pair it back i get error pop-up window saying;

Error validating annotation file: { "message": "Missing required property: name", "code": 302, "dataPath": "", "schemaPath": "/required/0", "subErrors": null, "stack": "Error: Missing required property: name\n at new f (http://localhost:9000/scripts/4ca856c7.emuwebAppExternal.min.js:9:10114)\n at i.createError (http://localhost:9000/scripts/4ca856c7.emuwebAppExternal.min.js:9:15063)\n at i.validateObjectRequiredProperties (http://localhost:9000/scripts/4ca856c7.emuwebAppExternal.min.js:9:25582)\n at i.validateObject (http://localhost:9000/scripts/4ca856c7.emuwebAppExternal.min.js:9:24784)\n at i.validateAll (http://localhost:9000/scripts/4ca856c7.emuwebAppExternal.min.js:9:18980)\n at Object.g.validate (http://localhost:9000/scripts/4ca856c7.emuwebAppExternal.min.js:9:10985)\n at Object.f.validateJSO (http://localhost:9000/scripts/a7995af7.emuwebApp.min.js:7:6403)\n at http://localhost:9000/scripts/a7995af7.emuwebApp.min.js:7:23506\n at i (http://localhost:9000/scripts/4ca856c7.emuwebAppExternal.min.js:5:13740)\n at http://localhost:9000/scripts/4ca856c7.emuwebAppExternal.min.js:5:13912" }

M&IExample.zip

raphywink commented 8 years ago

Thanks for pointing this out. I was able to reproduce the problem. @georgraess could you have a look at this? Probably a bug in the toJSO function of the textGridParserWorkerClass Tip: You'll have to remove the _text from the TextGrid name to make the drag & drop work.

mnrao2001 commented 8 years ago

We have no issues with .TextGrid file, I had added the suffix "_text.TextGrid" to filename for verbosity so that the sample files are identified easily by you folks for checking. But the actual issue is getting the "_annot.json" file to upload/import without any error pop-up as some of the headers like "name", "annotates" & "sampleRate" seems missing.

So, in future what will be the "naming convention" adopted for uploading/importing the TextGrid & JSON annotation files?

raphywink commented 8 years ago

@mnrao2001: For .TextGrid / .wav file pairs the base names of the two file names have to be the same (for example bla.wav & bla.TextGrid). That is why I just gave the hint to my coworker to rename the file so that the drag & drop functionality of the webApp actually works (otherwise there is a base name mismatch). This has nothing to do with the error you reported, which is probably due to a bug in our converter that creates a malformed _annot.json file.

The "naming convention" is and will be that the base names have to match. For files that belong to the emuDB format (see here https://github.com/IPS-LMU/emuR/blob/master/vignettes/emuDB.Rmd) the base name ends at the underscore (bla_annot.json). For other files (SSFF (.fms/.f0/.rms/...)/.wav/.TextGrid/.bpf/...) the base name ends at the dot (bla.TextGrid) which is the usual convention.

@georgraess: one thing we should also do is validate the _annot.json file either on creation of the download modal or on click of the download button. This would prevent this sort of thing from happening in the future.

georgbramm commented 8 years ago

Some metadata (name, samplerate, etc) were missing in the data model when dropping textgrids. so when exporting to _annot.json those fields were also missing which led to a validation error. The error was fixed in will be included in the next release.... ...unitl then you can modify "M&IExample_annot.json" like this.

{ "name": "M&IExample", "annotates": "M&IExample.wav", "sampleRate": 11025, "levels": [ { "name": "levelNr0", "type": "SEGMENT", "items": [ { "id": 0, "sampleStart": 51, .... ....

and it will work (in the meantime)