diff --git a/README.md b/README.md index 3467baa..488355e 100644 --- a/README.md +++ b/README.md @@ -141,15 +141,15 @@ You can test it's running by: `ps aux | grep -v grep | grep mongod` +#### NOTE: Manual operations on the MongoDB database +Whatever solution you choose to use to deploy your MongoDB database, if you perform manual operations on it such as document copies, document deletions or backup recovering, it's very important not to create duplicated documents. This precaution will prevent inconsistent and unexepected behaviour during Matilda's workflow. + ### Accessing the interface Each option you chose before you can now simply navigate to http://localhost:5000 if you installed the server locally or navigate to the remote server address. Keep in mind you may need to open the correct ports on your firewall(s) in order to reach the server. - -HTTP Requests from your client may not reach your server in some configuration environment, -in those few cases please check and edit the backend address in MATILDA's file `/web/server/gui/source/utils/backend.js`. Other configuration options are exposed in `/Configuration/conf.json`. ### First username and password @@ -166,19 +166,23 @@ All configuration changes that you may wish to make to MATILDA network and datab There you can change: - App ports (default 5000) and address (127.0.0.1) - Database location with address:port combination (127.0.0.1:27017) or mongoDB URI (mongodb://mongo:27017/?retryWrites=true&w=majority) - - The annotation models you want to be available inside MATILDA. The json files you are referring to must be included in the Configuration folder. + - The annotation models you want to be available inside MATILDA. The json files you are referring to, the models, must be included in the Configuration folder. + - Whether or not enforce session security (which is strongly advised) with the session_guard parameter. + - The event logging level saved in `/web/server/matilda.log` file. -If you are using the Docker version you can also perform additional configuration with `/Configuration/gunicorn_run.sh`. +If you are using the Docker version you can also perform additional configuration with `/Configuration/gunicorn_run.sh` in order to set the workers number and other gunicorn options. ### Annotation Models All configuration changes that you may wish to make to MATILDA's annotation model can be done by editing the json file `/Configuration/lida_model.json` or by adding a new one. This script contains a configuration dictionary that describes -which labels will appear in MATILDA's front end. +which labels will appear in MATILDA's annotation interface. You can also add an entire new annotation model file and put a reference to it in the `/Configuration/conf.json` file in order to instruct the program to load it on start. -You can currently add three different types of new labels to MATILDA: +## 3. Advanced Configuration + +Any annotation model has up to four different types of labels in MATILDA: 1. `multilabel_classification` :: will display as checkboxes which you can select one or more of. @@ -191,9 +195,9 @@ You can currently add three different types of new labels to MATILDA: 3. `string` :: will display underneath the user's utterance as a string response. This is the label field that would be used for a response to the user's query. - - -## 3. Advanced Configuration + +4. `global_classification_string` :: similar to multilabel_classification_string + but it's not dialogue turn-related, it refers to the entire dialogue. ### New Labels diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000..06cc165 --- /dev/null +++ b/changelog.md @@ -0,0 +1,67 @@ + + +# MATILDA: Multi-AnnoTator multi-language Interactive Lightweight Dialogue Annotator + +**Authors:** Davide Cucurnia, Nikolai Rozanov, Irene Sucameli, Augusto Ciuffoletti, Maria Simi + +**Contact:** contact@wluper.com + +**Paper:** [link to the EACL paper](https://www.aclweb.org/anthology/2021.eacl-demos.5/) + +### Citation at bottom of README! (Please cite when using) + +## 1.5 + +- Configuration view in Admin Panel +- Supervision annotation rate bars +- Supervision view now allows to upload an already annotated dialogue collection +- Supervision view now allows to edit turn utterances of collections +- Inter-annotator stats for multilabel-string-classification +- Annotation Rate for single dialogue is calculated anew when entering dialogue annotation mode + +## 1.4 + +- Dialogue annotation view displays few annotation customizable options: + - Resizable layout, useful for very large or very small screen layouts. + - Character limit for long utterances: after that number of character a scroll-bar will be shown. + - Auto-save on turn change on/off switch. + + +## Citation +Please cite these two papers when using. +``` +@inproceedings{cucurnia-etal-2021-matilda, + title = "{MATILDA} - Multi-{A}nno{T}ator multi-language {I}nteractive{L}ight-weight Dialogue Annotator", + author = "Cucurnia, Davide and + Rozanov, Nikolai and + Sucameli, Irene and + Ciuffoletti, Augusto and + Simi, Maria", + booktitle = "Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: System Demonstrations", + month = apr, + year = "2021", + address = "Online", + publisher = "Association for Computational Linguistics", + url = "https://www.aclweb.org/anthology/2021.eacl-demos.5", + pages = "32--39", + abstract = "Dialogue Systems are becoming ubiquitous in various forms and shapes - virtual assistants(Siri, Alexa, etc.), chat-bots, customer sup-port, chit-chat systems just to name a few.The advances in language models and their publication have democratised advanced NLP.However, data remains a crucial bottleneck.Our contribution to this essential pillar isMATILDA, to the best of our knowledge the first multi-annotator, multi-language dialogue annotation tool. MATILDA allows the creation of corpora, the management of users, the annotation of dialogues, the quick adaptation of the user interface to any language and the resolution of inter-annotator disagreement. We evaluate the tool on ease of use, annotation speed and interannotation resolution for both experts and novices and conclude that this tool not only supports the full pipeline for dialogue annotation, but also allows non-technical people to easily use it. We are completely open-sourcing the tool at https://github.com/wluper/matilda and provide a tutorial video1.", +} +``` + +``` +@inproceedings{collins-etal-2019-lida, + title = "{LIDA}: Lightweight Interactive Dialogue Annotator", + author = "Collins, Edward and + Rozanov, Nikolai and + Zhang, Bingbing", + booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP): System Demonstrations", + month = nov, + year = "2019", + address = "Hong Kong, China", + publisher = "Association for Computational Linguistics", + url = "https://www.aclweb.org/anthology/D19-3021", + doi = "10.18653/v1/D19-3021", + pages = "121--126", + abstract = "Dialogue systems have the potential to change how people interact with machines but are highly dependent on the quality of the data used to train them.It is therefore important to develop good dialogue annotation tools which can improve the speed and quality of dialogue data annotation. With this in mind, we introduce LIDA, an annotation tool designed specifically for conversation data. As far as we know, LIDA is the first dialogue annotation system that handles the entire dialogue annotation pipeline from raw text, as may be the output of transcription services, to structured conversation data. Furthermore it supports the integration of arbitrary machine learning mod-els as annotation recommenders and also has a dedicated interface to resolve inter-annotator disagreements such as after crowdsourcing an-notations for a dataset. LIDA is fully open source, documented and publicly available.[https://github.com/Wluper/lida] {--}{\textgreater} Screen Cast: https://vimeo.com/329824847", +} +``` diff --git a/configuration/conf.json b/configuration/conf.json index f335e53..c11c016 100644 --- a/configuration/conf.json +++ b/configuration/conf.json @@ -7,18 +7,17 @@ "lida_model.json", "unipi_model_v2.json" ], - "docker": false, "session_guard": true, - "full_log": false + "full_log": true }, "database": { - "name": "matilda", + "name": "matilda_wsgi", "legacy_configuration": { "address": "localhost", "port": 27017, "username": null, "password": null }, - "optional_uri": null + "optional_uri": "mongodb://mongo:27017/?retryWrites=true&w=majority" } -} \ No newline at end of file +} diff --git a/configuration/gunicorn_run.sh b/configuration/gunicorn_run.sh index 7c644dc..02cb197 100755 --- a/configuration/gunicorn_run.sh +++ b/configuration/gunicorn_run.sh @@ -1,2 +1,2 @@ #!/bin/sh -cd server; gunicorn --bind 0.0.0.0:5000 matilda_app:MatildaApp --log-file matilda.log --log-level 'info' +cd server; gunicorn --bind 0.0.0.0:5000 matilda_app:MatildaApp --log-file matilda.log --log-level 'info' \ No newline at end of file diff --git a/configuration/unipi_model.json b/configuration/unipi_model.json index 3c8065a..d7678c1 100644 --- a/configuration/unipi_model.json +++ b/configuration/unipi_model.json @@ -1,83 +1,68 @@ { - - "global_slot": { - - "description" : "General info related to the dialogue", - "label_type" : "multilabel_global_string", - "required" : false, - "labels" : [ - "result" - ] - }, - - "usr": { - "description" : "The user's query", - "label_type" : "string", - "required" : true - }, - - "sys": { - "description" : "The system's response", - "label_type" : "string", - "required" : true - }, - - "Dialogue_act": { - - "description" : "Type of dialogue act", - "label_type" : "multilabel_classification", - "required" : false, - "labels" :[ - "sys_greet", - "sys_inform_basic", - "sys_inform_proactive", - "sys_request", - "sys_select", - "sys_deny", - "usr_greet", - "usr_inform_basic", - "usr_inform_proactive", - "usr_request", - "usr_select", - "usr_deny" - ] - }, - - "Slot": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "job_description", - "contract", - "duties", - "skill", - "past_experience", - "degree", - "age", - "languages", - "area", - "company_name", - "company_size", - "location", - "contact", - "other" - ] - - }, - - "Async": { - - "description": "To annotate async messages", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - "turn_ref" - - ] - - } - + "Async": { + "description": "To annotate async messages", + "label_type": "multilabel_classification_string", + "labels": [ + "turn_ref" + ], + "required": false + }, + "Dialogue_act": { + "description": "Type of dialogue act", + "label_type": "multilabel_classification", + "labels": [ + "sys_greet", + "sys_inform_basic", + "sys_inform_proactive", + "sys_request", + "sys_select", + "sys_deny", + "usr_greet", + "usr_inform_basic", + "usr_inform_proactive", + "usr_request", + "usr_select", + "usr_deny" + ], + "required": false + }, + "Slot": { + "description": "Entity's value", + "label_type": "multilabel_classification_string", + "labels": [ + "job_description", + "contract", + "duties", + "skill", + "past_experience", + "degree", + "age", + "languages", + "area", + "company_name", + "company_size", + "location", + "contact", + "other" + ], + "required": false + }, + "global_slot": { + "description": "General info related to the dialogue", + "label_type": "multilabel_global_string", + "labels": [ + "result" + ], + "required": false + }, + "sys": { + "description": "The system's response", + "label_type": "string", + "required": true + }, + "usr": { + "description": "The user's query", + "label_type": "string", + "required": false } +} \ No newline at end of file diff --git a/configuration/unipi_model_v2.json b/configuration/unipi_model_v2.json index e6b5503..d3b1e4d 100644 --- a/configuration/unipi_model_v2.json +++ b/configuration/unipi_model_v2.json @@ -1,279 +1,228 @@ -{ - - "sys": { - "description" : "The system's query", - "label_type" : "string", - "required" : true - }, - - "usr": { - "description" : "The user's query", - "label_type" : "string", - "required" : true - }, - - "sys_greet": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "none" - ] - - }, - - "usr_greet": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "none" - ] - - }, - - "sys_inform_basic": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "none", - "job_description", - "contract", - "duties", - "skill", - "past_experience", - "degree", - "age", - "languages", - "area", - "company_name", - "company_size", - "location", - "contact", - "other" - ] - - }, - - "usr_inform_basic": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "none", - "job_description", - "contract", - "duties", - "skill", - "past_experience", - "degree", - "age", - "languages", - "area", - "company_name", - "company_size", - "location", - "contact", - "other" - ] - - }, - - "sys_inform_proactive": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "none", - "job_description", - "contract", - "duties", - "skill", - "past_experience", - "degree", - "age", - "languages", - "area", - "company_name", - "company_size", - "location", - "contact", - "other" - ] - - }, - - "sys_request": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "none", - "job_description", - "contract", - "duties", - "skill", - "past_experience", - "degree", - "age", - "languages", - "area", - "company_size", - "location" - ] - - }, - - "usr_inform_proactive": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "none", - "job_description", - "contract", - "skill", - "past_experience", - "degree", - "age", - "languages", - "area", - "company_size", - "location", - "other" - ] - - }, - - "usr_request": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "none", - "job_description", - "contract", - "duties", - "skill", - "past_experience", - "degree", - "age", - "languages", - "area", - "company_size", - "location" - ] - - }, - - "sys_select": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "none", - "job_description" - ] - - }, - - "usr_select": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "none", - "job_description" - ] - - }, - - "sys_deny": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "none", - "job_description", - "contract", - "duties", - "skill", - "past_experience", - "degree", - "age", - "languages", - "area", - "company_size", - "location" - ] - - }, - - "usr_deny": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "none", - "job_description", - "contract", - "duties", - "skill", - "past_experience", - "degree", - "age", - "languages", - "area", - "company_size", - "location" - ] - - }, - - "async": { - - "description": "To annotate async messages", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - "turn_ref" - ] - }, - - "global_slot": { - - "description" : "General info related to the dialogue", - "label_type" : "multilabel_global_string", - "required" : false, - "labels" : [ - "result" - ] - - } - - } +{ + "async": { + "description": "To annotate async messages", + "label_type": "multilabel_classification_string", + "labels": [ + "turn_ref" + ], + "required": false + }, + "global_slot": { + "description": "General info related to the dialogue", + "label_type": "multilabel_global_string", + "labels": [ + "result" + ], + "required": false + }, + "sys": { + "description": "The system's query", + "label_type": "string", + "required": true + }, + "sys_deny": { + "description": "Entity's value", + "label_type": "multilabel_classification_string", + "labels": [ + "none", + "job_description", + "contract", + "duties", + "skill", + "past_experience", + "degree", + "age", + "languages", + "area", + "company_size", + "location" + ], + "required": false + }, + "sys_greet": { + "description": "Entity's value", + "label_type": "multilabel_classification_string", + "labels": [ + "none" + ], + "required": false + }, + "sys_inform_basic": { + "description": "Entity's value", + "label_type": "multilabel_classification_string", + "labels": [ + "none", + "job_description", + "contract", + "duties", + "skill", + "past_experience", + "degree", + "age", + "languages", + "area", + "company_name", + "company_size", + "location", + "contact", + "other" + ], + "required": false + }, + "sys_inform_proactive": { + "description": "Entity's value", + "label_type": "multilabel_classification_string", + "labels": [ + "none", + "job_description", + "contract", + "duties", + "skill", + "past_experience", + "degree", + "age", + "languages", + "area", + "company_name", + "company_size", + "location", + "contact", + "other" + ], + "required": false + }, + "sys_request": { + "description": "Entity's value", + "label_type": "multilabel_classification_string", + "labels": [ + "none", + "job_description", + "contract", + "duties", + "skill", + "past_experience", + "degree", + "other", + "company_name", + "age", + "languages", + "area", + "company_size", + "location" + ], + "required": false + }, + "sys_select": { + "description": "Entity's value", + "label_type": "multilabel_classification_string", + "labels": [ + "none", + "job_description" + ], + "required": false + }, + "usr": { + "description": "The user's query", + "label_type": "string", + "required": true + }, + "usr_deny": { + "description": "Entity's value", + "label_type": "multilabel_classification_string", + "labels": [ + "none", + "job_description", + "contract", + "duties", + "skill", + "past_experience", + "degree", + "age", + "languages", + "area", + "company_size", + "location" + ], + "required": false + }, + "usr_greet": { + "description": "Entity's value", + "label_type": "multilabel_classification_string", + "labels": [ + "none" + ], + "required": false + }, + "usr_inform_basic": { + "description": "Entity's value", + "label_type": "multilabel_classification_string", + "labels": [ + "none", + "job_description", + "contract", + "duties", + "skill", + "past_experience", + "degree", + "age", + "languages", + "area", + "company_name", + "company_size", + "location", + "contact", + "other" + ], + "required": false + }, + "usr_inform_proactive": { + "description": "Entity's value", + "label_type": "multilabel_classification_string", + "labels": [ + "none", + "job_description", + "contract", + "skill", + "past_experience", + "degree", + "age", + "languages", + "area", + "company_size", + "location", + "other" + ], + "required": false + }, + "usr_request": { + "description": "Entity's value", + "label_type": "multilabel_classification_string", + "labels": [ + "none", + "job_description", + "contract", + "contact", + "duties", + "skill", + "past_experience", + "degree", + "age", + "languages", + "area", + "company_size", + "company_name", + "location", + "other" + ], + "required": false + }, + "usr_select": { + "description": "Entity's value", + "label_type": "multilabel_classification_string", + "labels": [ + "none", + "job_description" + ], + "required": false + } +} diff --git a/configuration/unipi_v2.json b/configuration/unipi_v2.json deleted file mode 100644 index 5e81eab..0000000 --- a/configuration/unipi_v2.json +++ /dev/null @@ -1,277 +0,0 @@ -{ - - "sys": { - "description" : "The user's query", - "label_type" : "string", - "required" : true - }, - - "usr": { - "description" : "The user's query", - "label_type" : "string", - "required" : true - }, - - - "sys_inform_basic": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "job_description", - "contract", - "duties", - "skill", - "past_experience", - "degree", - "age", - "languages", - "area", - "company_name", - "company_size", - "location", - "contact", - "other" - ] - - }, - - "usr_inform_basic": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "job_description", - "contract", - "duties", - "skill", - "past_experience", - "degree", - "age", - "languages", - "area", - "company_name", - "company_size", - "location", - "contact", - "other" - ] - - }, - - "sys_inform_proactive": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "job_description", - "contract", - "duties", - "skill", - "past_experience", - "degree", - "age", - "languages", - "area", - "company_name", - "company_size", - "location", - "contact", - "other" - ] - - }, - - "sys_request": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "job_description", - "contract", - "duties", - "skill", - "past_experience", - "degree", - "age", - "languages", - "area", - "company_name", - "company_size", - "location", - "contact", - "other" - ] - - }, - - "sys_select": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "job_description", - "contract", - "duties", - "skill", - "past_experience", - "degree", - "age", - "languages", - "area", - "company_name", - "company_size", - "location", - "contact", - "other" - ] - - }, - - "usr_greet": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "job_description", - "contract", - "duties", - "skill", - "past_experience", - "degree", - "age", - "languages", - "area", - "company_name", - "company_size", - "location", - "contact", - "other" - ] - - }, - - "usr_inform_proactive": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "job_description", - "contract", - "duties", - "skill", - "past_experience", - "degree", - "age", - "languages", - "area", - "company_name", - "company_size", - "location", - "contact", - "other" - ] - - }, - - "usr_request": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "job_description", - "contract", - "duties", - "skill", - "past_experience", - "degree", - "age", - "languages", - "area", - "company_name", - "company_size", - "location", - "contact", - "other" - ] - - }, - - "usr_select": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "job_description", - "contract", - "duties", - "skill", - "past_experience", - "degree", - "age", - "languages", - "area", - "company_name", - "company_size", - "location", - "contact", - "other" - ] - - }, - - "usr_deny": { - - "description" : "Entity's value", - "label_type" : "multilabel_classification_string", - "required" : false, - "labels" : [ - - "job_description", - "contract", - "duties", - "skill", - "past_experience", - "degree", - "age", - "languages", - "area", - "company_name", - "company_size", - "location", - "contact", - "other" - ] - - }, - - "global_slot": { - - "description" : "General info related to the dialogue", - "label_type" : "multilabel_global_string", - "required" : false, - "labels" : [ - "goal" - ] - - } - - } diff --git a/docker-compose.yml b/docker-compose.yml index 03c1b04..4cbdb5c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3.6' +version: '3' services: mongo: image: mongo:latest @@ -10,10 +10,8 @@ services: driver: "json-file" networks: - mongo_net - ports: - - 27017:27017 matilda: - image: davivcu/matilda:multimodel + image: davivcu/matilda:latest volumes: - ./configuration:/configuration restart: always diff --git a/nginx_configuration/conf.d/matilda.conf b/nginx_configuration/conf.d/matilda.conf deleted file mode 100644 index 100df23..0000000 --- a/nginx_configuration/conf.d/matilda.conf +++ /dev/null @@ -1,12 +0,0 @@ -upstream matilda { - server matilda:5000; - } -server { - listen 80; - listen 443 ssl; - ssl_certificate /etc/nginx/cert.pem; - ssl_certificate_key /etc/nginx/key.pem; - location / { - proxy_pass http://matilda; - } -} diff --git a/nginx_configuration/docker-compose_nginx.yml b/nginx_configuration/docker-compose_nginx.yml index 717ef15..f1d3ddf 100644 --- a/nginx_configuration/docker-compose_nginx.yml +++ b/nginx_configuration/docker-compose_nginx.yml @@ -1,4 +1,4 @@ -version: '3.6' +version: '3' services: mongo: image: mongo:latest @@ -13,7 +13,7 @@ services: ports: - 27017:27017 matilda: - image: davivcu/matilda:beta + image: davivcu/matilda:latest volumes: - ./configuration:/configuration restart: always @@ -26,8 +26,8 @@ services: nginx: image: nginx volumes: - - ./nginx_configuration/conf.d:/etc/nginx/conf.d - - ./nginx_configuration/make-ssl-certs.sh:/docker-entrypoint.d/40-make-ssl-certs.sh + - ./nginx_configuration:/etc/nginx/conf.d + - ./nginx_configuration/make-ssl-certs.sh:/docker-entrypoint.d/make-ssl-certs.sh restart: always networks: - nginx_net diff --git a/nginx_configuration/make-ssl-certs.sh b/nginx_configuration/make-ssl-certs.sh index b7fc8e6..d3ed59d 100755 --- a/nginx_configuration/make-ssl-certs.sh +++ b/nginx_configuration/make-ssl-certs.sh @@ -1,3 +1 @@ -#!/bin/sh -CONFDIR="/etc/nginx/" -openssl req -subj '/CN=localhost' -x509 -newkey rsa:4096 -nodes -keyout $CONFDIR/key.pem -out $CONFDIR/cert.pem -days 365 +openssl req -subj '/CN=localhost' -x509 -newkey rsa:4096 -nodes -keyout /etc/nginx/conf.d/key.pem -out /etc/nginx/conf.d/cert.pem -days 365 \ No newline at end of file diff --git a/nginx_configuration/nginx.conf b/nginx_configuration/nginx.conf index 100df23..e0fa0eb 100644 --- a/nginx_configuration/nginx.conf +++ b/nginx_configuration/nginx.conf @@ -4,9 +4,9 @@ upstream matilda { server { listen 80; listen 443 ssl; - ssl_certificate /etc/nginx/cert.pem; - ssl_certificate_key /etc/nginx/key.pem; + ssl_certificate /etc/nginx/conf.d/cert.pem; + ssl_certificate_key /etc/nginx/conf.d/key.pem; location / { proxy_pass http://matilda; } -} +} \ No newline at end of file diff --git a/web/server/annotator_config.py b/web/server/annotator_config.py index 3e0c2a0..a3a4fb0 100644 --- a/web/server/annotator_config.py +++ b/web/server/annotator_config.py @@ -15,7 +15,7 @@ # >>>> Local <<<< from dummy_models import TypeDummyModel, BeliefStateDummyModel, PolicyDummyModel, SysDummyModel -#logging.basicConfig(filename='matilda.log', level=logging.DEBUG, format='%(asctime)s VALIDATOR %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p', style='%') +logging.basicConfig(filename='matilda.log', level=logging.DEBUG, format='%(asctime)s VALIDATOR %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p', style='%') ############################################## # CONFIG Dict @@ -47,7 +47,6 @@ class responsible for configuration and valid annotation structure """ DEFAULT_PATH = "" - DOCKER = False #importing json configuration file try: @@ -56,7 +55,6 @@ class responsible for configuration and valid annotation structure conf = json.load(json_file) __DEFAULT_PATH = "configuration/" DEFAULT_PATH = __DEFAULT_PATH - DOCKER = True except: #standalone with open('../../configuration/conf.json') as json_file: @@ -110,13 +108,13 @@ def validate_dialogue(annotation_style, dialogue: List[Dict[str, Any]]) -> Union message = ("ERROR1: Label \'{}\' is listed as \"required\" in the " \ "config.py file, but is missing from the provided " \ "dialogue in turn {}.".format(labelName, i)) - logger.info(message, turn) + logging.info(message, turn) return message if info["required"] and not turn[labelName]: message = ("ERROR2: Required label, \'{}\', does not have a value " \ "provided in the dialogue in turn {}".format(labelName, i)) - logger.info(message, turn) + logging.info(message, turn) return message if info["required"] and ("multilabel_classification" == info["label_type"]): @@ -127,11 +125,11 @@ def validate_dialogue(annotation_style, dialogue: List[Dict[str, Any]]) -> Union message = "ERROR3: One of the provided labels in the list: " \ "\'{}\' is not in allowed list according to " \ "config.py in turn {}".format(providedLabels, i) - logger.info(message, turn) + logging.info(message, turn) return message except: message = "ERROR4: dialogue in list couldn't validate with the current annotation style model" - logger.info(message) + logging.info(message) return message return dialogue diff --git a/web/server/database.py b/web/server/database.py index f39b1a9..c1db4fe 100644 --- a/web/server/database.py +++ b/web/server/database.py @@ -45,7 +45,7 @@ class DatabaseManagement(object): logging.info(" * MATILDA: Connecting to database "+str(databaseURI)) client.server_info() except Exception as e: - logging.warning(" * "+e+"\n * Connecting Errror. Trying again with legacy configuration...") + logging.warning(" * "+str(e)+"\n * Error connecting to Database. Trying again with legacy configuration...") conf["database"]["optional_uri"] = None databaseURI = database_uri_compose(conf["database"]) client = MongoClient(databaseURI) @@ -139,6 +139,11 @@ def updateDoc(searchFields, collection, updateFields): DatabaseManagement.selected(collection).update(searchFields, { "$set": updateFields }) + def updateDocs(searchFields, collection, updateFields): + + DatabaseManagement.selected(collection).update_many(searchFields, { "$set": updateFields }) + + def pullFromDoc(doc_id, collection, field): value = field["dialogue"] @@ -169,7 +174,6 @@ def pullFromDoc(doc_id, collection, field): def dumpDatabase(): - collections = DatabaseManagement.db.collection_names() dump = {} for i, collection_name in enumerate(collections): @@ -270,7 +274,7 @@ def checkSession(): def start(): if DatabaseManagement.users.count_documents({"id":"admin"}) == 0: DatabaseManagement.users.insert_one(LoginFuncs.administratorDefault) - logging.info(" * Default admin account created: please log-in with username 'admin' and password 'admin'") + logging.warning(" * Default admin account created: please log-in with username 'admin' and password 'admin'") else: - logging.info(" * Connected to database "+str(DatabaseManagement.databaseURI)) + logging.warning(" * Connected to database "+str(DatabaseManagement.databaseURI)) diff --git a/web/server/gui/assets/css/all_dialogues.css b/web/server/gui/assets/css/all_dialogues.css index 18ee77b..b10c25f 100644 --- a/web/server/gui/assets/css/all_dialogues.css +++ b/web/server/gui/assets/css/all_dialogues.css @@ -80,8 +80,7 @@ list-style-type: none; margin-left: 0; padding-left: 0; - - padding: 0; + padding: 0 0 3% 0; margin: 0px -10px 35px; overflow:hidden; } @@ -254,8 +253,12 @@ background-color: rgb(0 0 0 / 10%); } -.container-bar .annotated-bar:nth-child(2n) { - border-left:4px solid black; +.container-bar .annotated-bar:nth-child(1) { + border-left:none; +} + +.container-bar .annotated-bar:nth-child(n) { + border-left:4px solid #000000ab; } .annotated-fill { diff --git a/web/server/gui/assets/css/annotation_app.css b/web/server/gui/assets/css/annotation_app.css index 6e2e62d..fa5eaed 100644 --- a/web/server/gui/assets/css/annotation_app.css +++ b/web/server/gui/assets/css/annotation_app.css @@ -123,13 +123,13 @@ textarea { resize: none; width: 100%; height: 100%; - overflow-y: scroll; + overflow-y: auto; display: inline-block; justify-self: center; margin: 0; outline: none; border: 1px solid #e1e1e3; - padding: 1px 15px; + padding: 10px 15px; border-left:none; } textarea:focus { @@ -533,7 +533,7 @@ WluperDark: 0e181e } .slider { - height: 8px; + height: 7px; background: #c2d5e3; outline: none; opacity: 0.7; @@ -589,10 +589,18 @@ WluperDark: 0e181e outline: none; border: 1px solid #e1e1e3; padding: 10px 15px; + overflow-y: scroll; -webkit-touch-callout: none; /* iOS Safari */ -webkit-user-select: none; /* Safari */ -khtml-user-select: none; /* Konqueror HTML */ -moz-user-select: none; /* Old versions of Firefox */ -ms-user-select: none; /* Internet Explorer/Edge */ user-select: none; +} + +.turn-editing-btn { + float:right; + background-color:red; + box-shadow: 0 2px darkred; + margin-top: -0.5%; } \ No newline at end of file diff --git a/web/server/gui/assets/css/database.css b/web/server/gui/assets/css/database.css index 0d45b5e..c95b5bf 100644 --- a/web/server/gui/assets/css/database.css +++ b/web/server/gui/assets/css/database.css @@ -92,6 +92,12 @@ float:left; } +.collection-list .entry-assigned { + max-width: 27em; + overflow: hidden; + height: 1em; +} + .annotation-list .listed-entry { margin: 10px 0; color: white; @@ -481,6 +487,10 @@ input:not(:checked) + div { padding-right: 1%; } +.tc-no-min { + height:auto; +} + .two-columns .listed-entry { width:100% !important; float:none !important; @@ -588,7 +598,7 @@ input[type="password"]:hover { } .dialogue-entry-list { - grid-template: [row1-start] "info del" [row1-end] / 3fr 0.6fr; + grid-template: [row1-start] "info edit del" [row1-end] / 3fr 0.6fr 0.6fr; display: grid; box-shadow: 0px 5px 5px rgba(0,0,0,0.05); transition: ease 175ms all; @@ -606,6 +616,15 @@ input[type="password"]:hover { transition: ease 250ms all; } +.dialogue-entry-info .entry-annotated { + font-size:10px; + padding-right:6px; +} + +.dialogue-entry-list .edit-dialogue-button { + margin-top: 10px; +} + /******************************* // CONFIGURATION VIEW *******************************/ diff --git a/web/server/gui/assets/css/main.css b/web/server/gui/assets/css/main.css index 00484cd..ab1172a 100644 --- a/web/server/gui/assets/css/main.css +++ b/web/server/gui/assets/css/main.css @@ -359,6 +359,7 @@ select { #supervision #dialogue-menu { height:3em; + grid-column-start: 1; } #supervision #dialogue-menu .back-button { @@ -442,7 +443,7 @@ select { .copyright { font-size: .8em; line-height: 4em; - color: #8a95a0; + color: #cad1d9; margin-left: 20px; } .foot-bar { diff --git a/web/server/gui/index.html b/web/server/gui/index.html index 9c7d6d8..ac698fe 100644 --- a/web/server/gui/index.html +++ b/web/server/gui/index.html @@ -17,21 +17,21 @@ CSS ---------------------------------------------------------------> - - + + - + - - - - - - - - + + + + + + + + @@ -70,7 +70,7 @@