Skip to content
/ piaf Public
forked from etalab/piaf

Question Answering annotation platform - Plateforme d'annotation du projet Piaf

License

Notifications You must be signed in to change notification settings

RachelKer/piaf

 
 

Repository files navigation

Piaf

Codacy Badge Build Status

Piaf is an open-source QA (question answering) annotation plateform.
It handles the following features :

  • nice UI (conceived by a designer)
  • contributor enrollment (signup & mail validation)
  • contributor certification (by any member of the admin team)
  • admin team administration (by the super-admin)
  • input/output of texts to be annotated using the SQuAD format
  • users scoring (for bot and troll removal)
  • annotations managment

1. Installation

First clone the repo:

git clone https://github.com/etalab/piaf.git
cd piaf

Then create the environment variables (you can customise your API keys and passwords):

cp .env-example .env

Now you have tow options : install the app with Docker or without

Installing with Docker

As a prerequisite, you need to have installed Docker & Docker-compose on your computer.

Then, type:

docker-compose pull

Installing without

As a prerequisite, you need to have installed on your computer:

  • Python 3.6+
  • Django 2.1.7+
  • Node.js 8.0+
  • Chromium (recommended)
  • Vue cli 4.4+ (more info here)

First install Python dependencies:

sudo apt-get install libpq-dev  # Linux/Debian only
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Then compile the frontend:

make build-statics

When developing the frontend, you may prefer watching for files changes. Run npm start (instead of npm run build) for building and hot reloading.

2. Running

Running with Docker

make up

Have a look at the Makefile for more details

Running without

First prepare the database:

cd src
python manage.py migrate

Then create the admin user:

python manage.py create_admin --noinput --username "admin" --email "[email protected]" --password "password"

And finally run the Django server:

python manage.py runserver

Note that Django permits to run the server on a different IP or port. python manage.py runserver <ip>:<port>

3. Setting up your annotation campaign

Reach the Admin panel

Open your web-browser at http://127.0.0.1:8000/login/ and login with the admin you created above (username: "admin", password: "password")

You will then be able to reach the admin panel, for any administration task you may require: 127.0.0.1:8000/admin

Importing texts

Go to : 127.0.0.1:8000/app/admin

Note that only JSON files can be imported. Furthermore, they need to match exaclty the SQuAD format. But, we accept some extra fields :

  • "categorie" : can be one of the followings - 'Religion', 'Géographie', 'Histoire', 'Sport', 'Arts', 'Société', 'Sciences' default to 'Société' if empty
  • "displaytitle" : if you need a more deligthful title (falls back to title if empty)
  • "reference" : integer like 7138870 for Wikipedia reference (falls back to 0 if empty)

Here is an example of input dataset: Click here to download

Annotation

Simply reach : app/

Exploring results

Again, on the page : app/admin

Only possible format is JSON.

configuration

Passing most settings as environment variable will override the default settings. Here are some of the variable customisable:

DJANGO_ALLOW_SIGNUP=True # Allow users to singup (for crowdsourcing)
DJANGO_USE_MAILJET=False # use Mailjet or the native Django mail service
DJANGO_MAILJET_API_KEY=ffdfsfcfs2a00ad5ef367bfdsflsdk # put your Mailjet API key here, this is an example resulting in Errors
DJANGO_MAILJET_SECRET_KEY=nhf41cc0d45ffsdfs6fdsfdsffdsfsf # put your Mailjet API secret here, this is an example resulting in Errors
MATOMO_SITE_ID= # Matomo id
WEBPACK_ENVIRONMENT_PRODUCTION=False # build the frontend  or run a 'npm run serve'

with Docker

Edit the .env file

without

Set the environment variable before launching your server

DEBUG=0 MATOMO_SITE_ID=77 src/manage.py runserver

this Will disable debugging and activate Matomo tracking for instance

Contact

Feel free to submit any feedback.

Acknowledgements

PIAF plateform was originally inspired by Doccano. The PIAF team contributed to Doccano repository until the Doccano project was to far from PIAF needs.

License

2018 chakki.
2019 DINUM, Guillim.
2020 DINUM, Guillim.

This application is published under the MIT license.

About

Question Answering annotation platform - Plateforme d'annotation du projet Piaf

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 57.2%
  • Vue 28.6%
  • HTML 7.3%
  • JavaScript 5.1%
  • Shell 1.0%
  • Dockerfile 0.4%
  • Other 0.4%