Dev Repo for covid19 application
Sihao's dev instance of the website: http://macniece.seas.upenn.edu:4020/
Link to our work document.
Instructions on setting up dev environment
The app is built upon Django framework. Here is a tutorial on how you would install django.
Once you have installed django, and every other packages in requirements.txt
, here is how you would run the server.
$ python manage.py runserver
This command will start a server on localhost. If you want it to be public facing -- Replace <port-number>
with, well, port number.
$ python manage.py runserver 0.0.0.0:<port-number>
For the server to function, you will need to provide credentials for a Google Custom Search Engine instance. The next section will show you how to set it up.
Steps for setting up Google Custom Search API
- Follow this tutorial to create a Google Custom Search Engine (CSE) instance. Be sure to save the api key of your CSE, as it will only be shown to you once during engine creation.
- In the CSE control panel, select the list of urls to search for this engine (e.g. nytimes.com, cdc.gov).
- Again in the CSE control panel, there is a Search Engine ID. Save it somewhere.
- if you haven't done so, install python package
google-api-python-client
- In project directory, there is a config file at
covid19/config/config.json
, in which you will fill the placeholder for Search Engine ID and api key.
Steps for setting up Quote Annotator server
-
wget http://nlp.stanford.edu/software/stanford-corenlp-full-2018-10-05.zip
-
unzip stanford-corenlp-full-2018-10-05.zip
-
cd stanford-corenlp-full-2018-10-05
-
java -Xmx10g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -annotators "tokenize,ssplit,pos,lemma,ner,depparse,coref,quote" -port 9000 -timeout 30000
Steps for setting up perspectives models
- Download relevance and stance Roberta models from google drive
- Unzip, and place respective folders in directory model/perspectives/
- Use command generated here to download Torch