Skip to content

martindsq/frecuencia-lexica-sp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Subjective Lexical Frequency in Rioplatense Spanish

Subjective Lexical Frequency in Rioplatense Spanish is a task that gathers subjective frequency ratings for 360 words from Rioplatense Spanish. The task was programmed using Django, Bootstrap and jsPsych, and can be run online or offline (it is configured to display a larger list of words if it is being run offline and a longer timeout for ending the task).

As this same web server could be easily adapted for running the task for a different set of words or even a different language (see instructions below), the source code is being made public for other researchers to use.

Installation

Important

If pip, venv or Postgres are not installed, install them first:

sudo apt install python3-pip
sudo apt install python3-venv
sudo apt install postgresql
  1. Create a new virtual environment:
python3 -m venv .venv
source .venv/bin/activate
  1. Install the dependencies:
python -m pip install -r requirements.txt
  1. Create the Postgres database:
createdb martin
sudo -u martin psql
CREATE DATABASE frecuencialexicasp WITH OWNER martin;
  1. Set-up the initial state of the database:
python manage.py collectstatic
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
python manage.py seed --mode=refresh

Starting the server

  1. Activate the virtual environment:
source .venv/bin/activate
  1. Start a web server on your local machine:
gunicorn mysite.wsgi

This will start a development server at localhost. You can open that address to run the task in online mode or you can open it in offline mode (it will use a larger set of stimuli and longer timeout), or even in debug mode (it just use a very small set of stimuli). Head to the settings site to configure the size of the set of stimuli in each mode, and to the admin site to see the replies and to API to interact with the REST interface.

Adaptation

Follow the next steps to either update the list of words or language the task is run in.

Updating the set of stimuli (images with words in Rioplatense Spanish)

  1. Place the image files at folder at frequencies/static/terms and update the CSV file accordingly at frequencies/management/commands/seed.csv.

  2. Activate the virtual environment:

source .venv/bin/activate
  1. Fill the database with the stimuli:
python manage.py seed --mode=refresh

Creating stimuli

In order to generate images from words in any given language, you can follow these steps:

  1. Install the image manipulation software suite:
sudo apt install imagemagick
  1. Create a PNG image with the word word with the following command:
convert -gravity center -pointsize 60 -extent 640x512 \
-size 640x512 -font Liberation-Serif \
caption:"word" word.png
  1. Repeat step 2 for every word in the set of desired stimuli.

  2. Place all the generated PNG files in the folder at static/terms

  3. Update the CSV file at frequencies/management/commands/seed.csv

  4. Activate the virtual environment:

source .venv/bin/activate
  1. Update the database by running:
python manage.py seed --mode=refresh

Updating the instructions

If the task is meant to be run for a different language, you will need to update the instructions and form as well (that is, everything visible to the user that is Spanish). To do so, walk through the following steps in the order you want:

  • The instructions and form questions can be updated in frequencies/views.py and frequencies/templates/index.html.

  • Update the information_paper.pdf file that is referenced in index.html.

  • The constrained set of replies the user can answer in the form are coded in frequencies/models.py (you will need to update the database afterwards: python manage.py migrate).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages