Contains the tool for viewing valency frames and adding user-defined senses to underlying sentences.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Go to file
voje c5fc78dca1
appindex to file instead of DB
5 years ago
data make sskj-senses 5 years ago
dip_src modifying frames api 5 years ago
dockerfiles Add backend-prod target (debug, 0.0.0.0, 8084) 5 years ago
old_api_examples some more old_api output 5 years ago
src appindex to file instead of DB 5 years ago
test_make added env.local -- gitignored credentials file 5 years ago
.gitignore appindex to file instead of DB 5 years ago
.gitmodules make fill_database 5 years ago
Makefile appindex to file instead of DB 5 years ago
README.md appindex to file instead of DB 5 years ago
env.default added env.local -- gitignored credentials file 5 years ago

README.md

cjvt-valency

Required submodules:

  • https://gitea.cjvt.si/kristjan/cjvt-corpusparser.git
$ git submodule init
$ git submodule update

Components

Credentials

Copy env.default to env.local (gitignored).
Modify database credentials in env.local.
The file is used by make.

Database (2 containers)

Set db admin, user, pass, etc in 'Makefile'.
Spin up the database service and create users:
Make sure you create a folder for the data on host machine (see mongodb-stack.yml volumes.

$ mkdir -p ${HOME}/mongo_container/data/  # default one
# $ make database-clean  # opt, removes docker services, not data
$ make database-service
$ make database-users  # only first time; user data persists too

Populate the database with data form files:

  • ssj500k.xml
  • kres.xml
  • kres_SRL.json

Set path to files in Makefile.

# spin up a container with python env
$ make python-env

# install our packages
$ make python-env-install

# run the code
# beforehand, set the data files in Makefile
# instead of mounting directories into the container, you can
# create a link inside ./data, that points to the desired location 

# I've separated the processes for better memory management
$ make fill-database-ssj

$ make fill-database-kres
# You can detach from the running process using Ctrl-p + Ctrl-q

# this is a long operation
# if running on a remote server, use nohup:
$ nohup $(make fill-database > fill-database.log) &

If all goes well, we should be able to inspect the database, filled with corpora, on 0.0.0.0:8087.

Flask backend (1 container)

Relies heavily on the database. Set that up first.

# spin up container
$ make python-env

# install our packages
$ make python-env-install

# needs to be ran once to modify a new database
$ make backend-prepare-db

# if you have the file prepared (sskj_senses.json), you can
# fill the database with some senses
$ make sskj-senses

# with debugger
$ make backend-dev

# production
$ make backend-prod

API endpoints:

  • GET word list (pre-cached)
  • GET reduced frames (pre-cached)
  • POST senses
  • User auth logic

Vue frontend (1 container)

Relies on Flask backend.
Before running make, you might need to set the correct api address.
Check ./src/frontend_vue/config/config_prod.json.
bash

# $ make frontend-dev  # development
$ make frontend-prod

App available on: http://0.0.0.0:8080.