TARGER consists from three different parts:
- Frontend
- Backend
- Batch processing (building the search index)
The frontend is a webserver built with the Flask framework, to use the argument search engine with a web browser.
The backend contains logic for argument classification and generating the annotated results. It exposes a REST-like API which is used by the frontend. The backend depends on the BiLSTM-CNN-CRF architecture for sequence tagging. A Swagger API interface allows for quickly testing annotation and documents the API.
Both backend and frontend can run behind a reverse proxy like Nginx or Apache 2.
However, you must configure the reverse proxy to forward the original address and some additional headers.
If you don't specify X-Script-Name
, the backend will confuse API endpoints and Swagger won't work.
Nginx configuration
location /subdir {
proxy_pass http://HOSTNAME:PORT;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Script-Name /subdir;
}
Apache 2 configuration
<Location /subdir>
Header add X-Script-Name "/subdir"
RequestHeader set X-Script-Name "/subdir"
ProxyPass http://HOSTNAME:PORT
ProxyPassReverse http://HOSTNAME:PORT
</Location>
The batch processing module provides scripts for argument labeling and indexing to Elasticsearch.
Data is being parsed and labeled by applying the model in a parallel way.
Data produced by argument labeling is being parsed and saved to the ES index.