# Generated by Django 2.0.4 on 2018-04-08 08:35

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='al_project',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('data_path', models.CharField(help_text='the data folder needs following subfolders: texts, data, model_1, model_2. model_1 should contain the spacy model to start training from.', max_length=255, verbose_name='path of the data folder')),
                ('num_retrain', models.PositiveSmallIntegerField(default=10, verbose_name='number of examples before retraining')),
                ('num_plus_retrain', models.PositiveSmallIntegerField(default=5, verbose_name='number of cases to work ahead')),
                ('ner_type', models.CharField(blank=True, max_length=50, null=True, verbose_name='ner types to work on')),
                ('keep_models', models.BooleanField(default=False, verbose_name='wether to keep old models after retraining')),
                ('al_strategy', models.CharField(choices=[('max score', 'max score'), ('median score', 'median score')], max_length=50, verbose_name='strategy to use for picking cases')),
                ('language_model', models.CharField(default='de', max_length=3, verbose_name='spacy language abbreviation')),
            ],
        ),
        migrations.CreateModel(
            name='case',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('decission', models.PositiveSmallIntegerField(blank=True, choices=[(0, 'skip'), (1, 'correct'), (2, 'wrong')], null=True)),
                ('hash', models.CharField(max_length=255, verbose_name='hash of the sentence file and position')),
                ('sentence', models.TextField(verbose_name='field to store the complete case')),
                ('suggestion', models.CharField(blank=True, max_length=50, null=True, verbose_name='the models suggestion')),
                ('probability', models.FloatField(blank=True, null=True, verbose_name='probability of the model for the case')),
                ('use', models.BooleanField(default=True, verbose_name='whether to use the case in the next iteration')),
                ('start', models.PositiveIntegerField(verbose_name='token offset start')),
                ('end', models.PositiveIntegerField(verbose_name='token offset end')),
                ('start_char', models.PositiveIntegerField(verbose_name='charcter offset start')),
                ('end_char', models.PositiveIntegerField(verbose_name='character offset end')),
                ('text_file', models.CharField(max_length=255, verbose_name='path of the text file')),
                ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='spacyal.al_project')),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
