Skip to content

Commit

Permalink
Merge branch 'master' into nert-server2
Browse files Browse the repository at this point in the history
  • Loading branch information
nschneid committed Nov 21, 2021
2 parents cab8c0e + 4c46f15 commit 92146d1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ from .base import *
python xposition/manage.py migrate
```

4. _(optional)_ Instead of using a blank database, you may place a copy of the production
database in `xposition/xp/db/prepopulated.db`. Ask Nathan for a backup. If the backup
is a SQL dump instead of a raw database file, you may reconsistute the database like below.
Note that some backups end in a `ROLLBACK;` for some reason--check to see if it's there and
replace it with an `END` instead.

```
sqlite3 prepopulated.db < prod_dump.sql
```

## Running
You should now be able to run the server:

Expand Down Expand Up @@ -100,6 +110,12 @@ It comes with a prepopulated SQLite database.

We use the library django-import-export for loading new models when there are too many to create by hand. Developers can follow the following procedure to load a new corpus into the database.

### Sentence and Document IDs
Before import, make sure that [the way `doc_id` is set](https://github.com/nert-nlp/Xposition/blob/master/xposition/scripts/new_corpus.py#L121) is appropriate for your corpus.
If it is not, then either temporarily change the import script or change your document IDs.

### Performing the Import

- On the webpage, click the language you are working with and then click metadata (You may first need to create the Language object if it doesn't exist. In this case, click metadata on the homepage). Click `Create a Corpus` and fill out the form.
- The corpus you want to import must be in the STREUSLE json format. Place it in the directory `<Xposition>/xposition/scripts`.
- Modify the top of the file `new_corpus.py` so that the constants `LANGUAGE`, `CORPUS`, etc. are correct.
Expand Down
2 changes: 1 addition & 1 deletion xposition/xp/templates/500.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<h1 class="page-header">{% trans "500 - ERROR" %}</h1>

<div class="error">
<p>{% blocktrans trimmed %]
<p>{% blocktrans trimmed %}
Oh god no the demo has failed. Please rest assured that an open source developer is reading the
logs to resolve this, because it's fun!!
{% endblocktrans %}
Expand Down

0 comments on commit 92146d1

Please sign in to comment.