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

add comments and have them saved? #268

Closed kirbyj closed 4 years ago

kirbyj commented 4 years ago

Assume you have created demo database ae.

  1. edit the .json file to add "bundleComments": true, etc. to end of file:
"activeButtons": {
      "saveBundle": true,
      "showHierarchy": true
    },
"restrictions": {
      "showPerspectivesSidebar": true,
      "bundleComments": true,
      "bundleFinishedEditing": true
   }
  1. Serve db, add comments on web-App and save everything.

  2. Re-load and serve db:

db_handle = load_emuDB(dbPath, verbose = F)
serve(db_handle)
  1. Check web-App and individual .json files for commented tokens, but comments have not been saved.
raphywink commented 4 years ago

Comments and finished editing values are stored in a users bundle list and not the annot.json file. I updated the serve() function to work with these a few weeks ago (might still not be in the CRAN release though... would have to double check):

# list all files in session "0000"
bndls = list_bundles(db, 
                     session = "0000")
# write these to a bundle list called raphael.winkelmann
# therefore assigning them to that user (a dir bundleLists is created in the emuDB if not present)
write_bundleList(db, 
                 name = "raphael.winkelmann", 
                 bndls)

# serve db and list name of bundle.list
# and add a comment + save
serve(db, bundleListName = "raphael.winkelmann")

# test if comment is available
read_bundleList(db, 
                name = "raphael.winkelmann")
raphywink commented 4 years ago

Just checked and def. not in CRAN release yet so you'll need to install emuR via devtools::install_github(IPS-LMU/emuR)

raphywink commented 4 years ago

I should probably implement a check if bundleComments and/or bundleFinishedEditing is set to true and no bunldeListName is specified and issue a warning that these values will not be saved.

brisaann commented 4 years ago

Is there a way to set up the bundle list so that one bundle list name contains multiple sessions (where each session = a speaker with their individual set of tokens)? I would like to serve all my sessions at once in the WebApp and collectively add/edit comments. Right now I am creating one bundle list per individual session and serving each bundle list individually.

raphywink commented 4 years ago

https://github.com/IPS-LMU/emuR/commit/1b3c2d60f606398ff7ca522683a3cde50e483768 implements a warning (is actually an emuR issue not a EMU-webApp issue)

raphywink commented 4 years ago

@brisaann if you simply don't specify a session in list_bundles() then you'll get every bundle of the emuDB. Using the above code will then gen. a bundleList that contains every bundle of the emuDB.