Coder Social home page Coder Social logo

persephone-web-api's People

Contributors

aapeliv avatar shuttle1987 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

aapeliv

persephone-web-api's Issues

Reference to utterances in Audio and Transcription results

Currently if you GET either of these you get a reference to where these are used in Utterances:

*** uploading WAV files ***
{
  "filename": "crdo-NRU_F4_ACCOMP_PFV.1_21.wav",
  "id": 1,
  "in_utterances": [],
  "url": "uploads/audio_uploads/crdo-NRU_F4_ACCOMP_PFV.1_21.wav"
}
*** uploading transcription files ***
{
  "filename": "crdo-NRU_F4_ACCOMP_PFV.1_23.phonemes",
  "id": 1,
  "in_utterances": [],
  "url": "uploads/text_uploads/crdo-NRU_F4_ACCOMP_PFV.1_23.phonemes"
}

This currently is not in agreement with the API specification. Should we expose this information to the user from these endpoints or not? (Incidentally this is the exact sort of issue that GraphQL solves nicely)

Serialization of CorpusSchema gives wrong primary keys

Consider this script to create a corpus via Curl:

# This is a very quick and dirty to populate some initial data via calling the API.
# Note that for now ID's are hardcoded in later steps.
# TODO: process response data IDs
# Upload WAV files
echo "*** uploading WAV files ***"
curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --form audioFile=@crdo-NRU_F4_ACCOMP_PFV.1.wav 'http://127.0.0.1:8080/v0.1/audio'
curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --form audioFile=@crdo-NRU_F4_ACCOMP_PFV.3.wav 'http://127.0.0.1:8080/v0.1/audio'
curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --form audioFile=@crdo-NRU_F4_ACCOMP_PFV.7.wav 'http://127.0.0.1:8080/v0.1/audio'
# Upload transcriptions
echo "*** uploading transcription files ***"
curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --form transcriptionFile=@crdo-NRU_F4_ACCOMP_PFV.1.phonemes 'http://127.0.0.1:8080/v0.1/transcription'
curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --form transcriptionFile=@crdo-NRU_F4_ACCOMP_PFV.3.phonemes 'http://127.0.0.1:8080/v0.1/transcription'
curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --form transcriptionFile=@crdo-NRU_F4_ACCOMP_PFV.7.phonemes 'http://127.0.0.1:8080/v0.1/transcription'
# Create Utterances
echo "*** specifying utterances ***"
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
   "audioId": 1,
   "transcriptionId": 1
 }' 'http://127.0.0.1:8080/v0.1/utterance'
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
   "audioId": 2,
   "transcriptionId": 2
 }' 'http://127.0.0.1:8080/v0.1/utterance'
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
   "audioId": 3, 
   "transcriptionId": 3 
 }' 'http://127.0.0.1:8080/v0.1/utterance'

# Create corpus
echo "*** creating corpus ***"
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/problem+json' -d '{
   "name": "Test Corpus", 
   "label_type": "phonemes",
   "feature_type": "fbank",
   "testing": [
     1
   ],
   "training": [
     2
   ],
   "validation": [
     3
   ]
 }' 'http://127.0.0.1:8080/v0.1/corpus'

Gives this:

{
  "feature_type": "fbank",
  "filesystem_path": "f2976bee-900f-11e8-9a5f-d8cb8acb264b",
  "id": 1,
  "label_type": "phonemes",
  "max_samples": null,
  "name": "Test Corpus",
  "preprocessed": false,
  "testing": [
    1
  ],
  "training": [
    1
  ],
  "validation": [
    1
  ]
}

The test, train, validation are the primary keys of the DataSet DB models, NOT the utterance primary keys.

Serialization for audio and transcriptions duplicates utterance relation information

{
  "filename": "crdo-NRU_F4_ACCOMP_PFV.1_16.wav",
  "id": 1,
  "in_utterances": [],
  "url": "uploads/audio_uploads/crdo-NRU_F4_ACCOMP_PFV.1_16.wav",
  "utterances": []
}

{
  "filename": "crdo-NRU_F4_ACCOMP_PFV.1_18.phonemes",
  "id": 1,
  "in_utterances": [],
  "url": "uploads/text_uploads/crdo-NRU_F4_ACCOMP_PFV.1_18.phonemes",
  "utterances": []
}

In this in_utterances is a duplicate of utterances.

Specify errors in API responses

There are times where returning error information will make the frontend much easier to write. For example a mismatch of label types would be a good thing to have an error response about.

Filenames and duplicates

Currently when you upload more than one file of the same name a duplication check is performed so that nothing is overwritten but that means when you download the file again the name can be different to the name of the file you uploaded. This is something that needs a bit of attention.

Should duplicate files have the same ID or different IDs?

Improve path handling for Corpus creation

Currently the corpus name is used in the filename for ease of development, this isn't good practice for a variety of reasons and will need to be changed for a production release.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.