proycon / flat

FoLiA Linguistic Annotation Tool -- Flat is a web-based linguistic annotation environment based around the FoLiA format (http://proycon.github.io/folia), a rich XML-based format for linguistic annotation. Flat allows users to view annotated FoLiA documents and enrich these documents with new annotations, a wide variety of linguistic annotation types is supported through the FoLiA paradigm.
GNU General Public License v3.0
111 stars 15 forks source link

Offline version of FLAT? #182

Closed luutuntin closed 2 years ago

luutuntin commented 2 years ago

Hi Maarten,

We have a collaborator currently living in Kharkiv, Ukraine. She hasn't been able to work with us, mainly using FLAT, since the war started due to no access to reliable Internet connection. We are thinking of resuming her work by instructing her to create an offline version of FLAT on her PC computer. As she is not a programmer, the instruction should be as simple as possible. Do you have any experience of supporting similar cases or any advice for us?

Best, Alex

proycon commented 2 years ago

Hi Alex,

FLAT is currently included in LaMachine and can already be run locally through a virtual machine if she's on a Windows system. However, there are two caveats you'll probably run into:

1) You'll want to ship a specific FLAT configuration for your annotation task 2) FoLiA/FLAT tends to reference set definitions for the vocabulary which may live anywhere on the web and are obtained on-the-fly, this will time-out if there's no connection.

We're slowly deprecating our LaMachine solution and I'm planning to create a more lightweight FLAT OCI/docker container (I can do that this week). This could then be used for your use case, you can simply expand upon the Dockerfile then. On the user-end she'd then only need the docker daemon (which will arrange virtualisation in case she's on Windows) and can then connect via localhost. I'd still have to find a fitting solution for the 2nd problem (using some local cache dir probably) but that looks doable. I certainly want to support this use-case as I also consider offline-usage important in general, and this specific case is of course a painful illustration of why we can't always assume everybody to be connected all the time.

luutuntin commented 2 years ago

Thank you so much, Maarten. The lightweight FLAT OCI/docker container sounds really neat. We look forward to your update on that and the solution for the 2nd problem.

proycon commented 2 years ago

This is now implemented and released (v0.11). There is a new OCI/Docker container available and you can now specify the FLAT configuration via external yaml files (point 1) and some environment variables (so you don't have to edit settings.py) and can use the contaimer image as-is. The FLAT Documentation has been updated accordingly.

Regarding the inability to download set definitions (point 2) when offline, I implemented a FOLIAPY_FORCE_LOCALSETDIR environment variable in the FoLiA Python library. This you can set to a directory that holds the pre-downloaded set definitions (this should be put on a persistent volume mounted into the container, just like the directory for the FoLiA data (FLAT_DOCROOT) and the external yaml configurations (FLAT_CONFIG_DIR)). The folia library will then attempt a simple match on filename (basename). You can simply pass this environment variable to the FLAT docker container to enable this functionality.

luutuntin commented 2 years ago

Thank you. I have managed to create a working offline instance of FLAT with our specific configuration.