diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 1d6fabe..0000000 --- a/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "bert_pretraining/bert"] - path = bert_pretraining/bert - url = https://github.com/onurgu/bert.git -[submodule "bert_pretraining/bert_google"] - path = bert_pretraining/bert_google - url = https://github.com/haozturk/bert.git diff --git a/error_analysis/bertcustom_2020-01-09_02_false_word_freq b/analysis/error_analysis/bertcustom_2020-01-09_02_false_word_freq similarity index 100% rename from error_analysis/bertcustom_2020-01-09_02_false_word_freq rename to analysis/error_analysis/bertcustom_2020-01-09_02_false_word_freq diff --git a/error_analysis/bertcustom_2020-01-09_02_true_word_freq b/analysis/error_analysis/bertcustom_2020-01-09_02_true_word_freq similarity index 100% rename from error_analysis/bertcustom_2020-01-09_02_true_word_freq rename to analysis/error_analysis/bertcustom_2020-01-09_02_true_word_freq diff --git a/error_analysis/bertcustom_2020-01-09_02_type1_errors b/analysis/error_analysis/bertcustom_2020-01-09_02_type1_errors similarity index 100% rename from error_analysis/bertcustom_2020-01-09_02_type1_errors rename to analysis/error_analysis/bertcustom_2020-01-09_02_type1_errors diff --git a/error_analysis/bertcustom_2020-01-09_02_type1_errors_probs b/analysis/error_analysis/bertcustom_2020-01-09_02_type1_errors_probs similarity index 100% rename from error_analysis/bertcustom_2020-01-09_02_type1_errors_probs rename to analysis/error_analysis/bertcustom_2020-01-09_02_type1_errors_probs diff --git a/error_analysis/bertcustom_2020-01-09_02_type2_errors b/analysis/error_analysis/bertcustom_2020-01-09_02_type2_errors similarity index 100% rename from error_analysis/bertcustom_2020-01-09_02_type2_errors rename to analysis/error_analysis/bertcustom_2020-01-09_02_type2_errors diff --git a/error_analysis/bertcustom_2020-01-09_02_type2_errors_probs b/analysis/error_analysis/bertcustom_2020-01-09_02_type2_errors_probs similarity index 100% rename from error_analysis/bertcustom_2020-01-09_02_type2_errors_probs rename to analysis/error_analysis/bertcustom_2020-01-09_02_type2_errors_probs diff --git a/error_analysis/scripts/analyze_colocation.py b/analysis/error_analysis/scripts/analyze_colocation.py similarity index 100% rename from error_analysis/scripts/analyze_colocation.py rename to analysis/error_analysis/scripts/analyze_colocation.py diff --git a/game_data_analysis/Game_Data_Analysis.ipynb b/analysis/game_data_analysis/Game_Data_Analysis.ipynb similarity index 100% rename from game_data_analysis/Game_Data_Analysis.ipynb rename to analysis/game_data_analysis/Game_Data_Analysis.ipynb diff --git a/perturbation/README.md b/analysis/perturbation/README.md similarity index 100% rename from perturbation/README.md rename to analysis/perturbation/README.md diff --git a/perturbation/perturb.py b/analysis/perturbation/perturb.py similarity index 100% rename from perturbation/perturb.py rename to analysis/perturbation/perturb.py diff --git a/scripts/conll_sample_creator.py b/analysis/scripts/conll_sample_creator.py similarity index 100% rename from scripts/conll_sample_creator.py rename to analysis/scripts/conll_sample_creator.py diff --git a/scripts/convert_bert_tensorflow_checkpoint_to_pytorch_model.sh b/analysis/scripts/convert_bert_tensorflow_checkpoint_to_pytorch_model.sh similarity index 100% rename from scripts/convert_bert_tensorflow_checkpoint_to_pytorch_model.sh rename to analysis/scripts/convert_bert_tensorflow_checkpoint_to_pytorch_model.sh diff --git a/scripts/convert_tf_to_pytorch.sh b/analysis/scripts/convert_tf_to_pytorch.sh similarity index 100% rename from scripts/convert_tf_to_pytorch.sh rename to analysis/scripts/convert_tf_to_pytorch.sh diff --git a/scripts/create-corpus.sh b/analysis/scripts/create-corpus.sh similarity index 100% rename from scripts/create-corpus.sh rename to analysis/scripts/create-corpus.sh diff --git a/scripts/export_data_to_google_sheets.py b/analysis/scripts/export_data_to_google_sheets.py similarity index 100% rename from scripts/export_data_to_google_sheets.py rename to analysis/scripts/export_data_to_google_sheets.py diff --git a/scripts/extract_errors.py b/analysis/scripts/extract_errors.py similarity index 100% rename from scripts/extract_errors.py rename to analysis/scripts/extract_errors.py diff --git a/scripts/morph-analyze.sh b/analysis/scripts/morph-analyze.sh similarity index 100% rename from scripts/morph-analyze.sh rename to analysis/scripts/morph-analyze.sh diff --git a/scripts/sentence_tokenizer.py b/analysis/scripts/sentence_tokenizer.py similarity index 100% rename from scripts/sentence_tokenizer.py rename to analysis/scripts/sentence_tokenizer.py diff --git a/test/test_baseline_models.py b/analysis/test/test_baseline_models.py similarity index 100% rename from test/test_baseline_models.py rename to analysis/test/test_baseline_models.py diff --git a/bert_pretraining/BERT_PRETRAINING.md b/analysis/training/bert_pretraining/BERT_PRETRAINING.md similarity index 100% rename from bert_pretraining/BERT_PRETRAINING.md rename to analysis/training/bert_pretraining/BERT_PRETRAINING.md diff --git a/bert_pretraining/bert b/analysis/training/bert_pretraining/bert similarity index 100% rename from bert_pretraining/bert rename to analysis/training/bert_pretraining/bert diff --git a/bert_pretraining/bert_config_small_turkish.json b/analysis/training/bert_pretraining/bert_config_small_turkish.json similarity index 100% rename from bert_pretraining/bert_config_small_turkish.json rename to analysis/training/bert_pretraining/bert_config_small_turkish.json diff --git a/bert_pretraining/bert_google b/analysis/training/bert_pretraining/bert_google similarity index 100% rename from bert_pretraining/bert_google rename to analysis/training/bert_pretraining/bert_google diff --git a/bert_pretraining/correct_punctiation_errors.sh b/analysis/training/bert_pretraining/correct_punctiation_errors.sh similarity index 100% rename from bert_pretraining/correct_punctiation_errors.sh rename to analysis/training/bert_pretraining/correct_punctiation_errors.sh diff --git a/bert_pretraining/rename_files.py b/analysis/training/bert_pretraining/rename_files.py similarity index 100% rename from bert_pretraining/rename_files.py rename to analysis/training/bert_pretraining/rename_files.py diff --git a/bert_pretraining/run_create_pretraining_data.sh b/analysis/training/bert_pretraining/run_create_pretraining_data.sh similarity index 100% rename from bert_pretraining/run_create_pretraining_data.sh rename to analysis/training/bert_pretraining/run_create_pretraining_data.sh diff --git a/bert_pretraining/run_create_pretraining_data_chunks.sh b/analysis/training/bert_pretraining/run_create_pretraining_data_chunks.sh similarity index 100% rename from bert_pretraining/run_create_pretraining_data_chunks.sh rename to analysis/training/bert_pretraining/run_create_pretraining_data_chunks.sh diff --git a/bert_pretraining/run_extract_features.sh b/analysis/training/bert_pretraining/run_extract_features.sh similarity index 100% rename from bert_pretraining/run_extract_features.sh rename to analysis/training/bert_pretraining/run_extract_features.sh diff --git a/bert_pretraining/run_pretraining.sh b/analysis/training/bert_pretraining/run_pretraining.sh similarity index 100% rename from bert_pretraining/run_pretraining.sh rename to analysis/training/bert_pretraining/run_pretraining.sh diff --git a/bert_pretraining/run_sentencepiece_trainer.sh b/analysis/training/bert_pretraining/run_sentencepiece_trainer.sh similarity index 100% rename from bert_pretraining/run_sentencepiece_trainer.sh rename to analysis/training/bert_pretraining/run_sentencepiece_trainer.sh diff --git a/bert_pretraining/sentence_tokenizer.py b/analysis/training/bert_pretraining/sentence_tokenizer.py similarity index 100% rename from bert_pretraining/sentence_tokenizer.py rename to analysis/training/bert_pretraining/sentence_tokenizer.py diff --git a/bert_pretraining/sentencepiece_trainer.py b/analysis/training/bert_pretraining/sentencepiece_trainer.py similarity index 100% rename from bert_pretraining/sentencepiece_trainer.py rename to analysis/training/bert_pretraining/sentencepiece_trainer.py diff --git a/bert_pretraining/vocab_converter.py b/analysis/training/bert_pretraining/vocab_converter.py similarity index 100% rename from bert_pretraining/vocab_converter.py rename to analysis/training/bert_pretraining/vocab_converter.py diff --git a/flair_training/bak/parameter_optimizer.py b/analysis/training/flair_training/bak/parameter_optimizer.py similarity index 100% rename from flair_training/bak/parameter_optimizer.py rename to analysis/training/flair_training/bak/parameter_optimizer.py diff --git a/flair_training/bak/train_bert.py b/analysis/training/flair_training/bak/train_bert.py similarity index 100% rename from flair_training/bak/train_bert.py rename to analysis/training/flair_training/bak/train_bert.py diff --git a/flair_training/bak/train_flair.py b/analysis/training/flair_training/bak/train_flair.py similarity index 100% rename from flair_training/bak/train_flair.py rename to analysis/training/flair_training/bak/train_flair.py diff --git a/flair_training/bak/train_flair_gpu.py b/analysis/training/flair_training/bak/train_flair_gpu.py similarity index 100% rename from flair_training/bak/train_flair_gpu.py rename to analysis/training/flair_training/bak/train_flair_gpu.py diff --git a/flair_training/convert_embedding_from_glove_to_gensim.py b/analysis/training/flair_training/convert_embedding_from_glove_to_gensim.py similarity index 100% rename from flair_training/convert_embedding_from_glove_to_gensim.py rename to analysis/training/flair_training/convert_embedding_from_glove_to_gensim.py diff --git a/flair_training/convert_embedding_from_word2vec_to_gensim.py b/analysis/training/flair_training/convert_embedding_from_word2vec_to_gensim.py similarity index 100% rename from flair_training/convert_embedding_from_word2vec_to_gensim.py rename to analysis/training/flair_training/convert_embedding_from_word2vec_to_gensim.py diff --git a/flair_training/convert_vocab.py b/analysis/training/flair_training/convert_vocab.py similarity index 100% rename from flair_training/convert_vocab.py rename to analysis/training/flair_training/convert_vocab.py diff --git a/flair_training/train.py b/analysis/training/flair_training/train.py similarity index 100% rename from flair_training/train.py rename to analysis/training/flair_training/train.py diff --git a/xnlp/__init__.py b/analysis/xnlp/__init__.py similarity index 100% rename from xnlp/__init__.py rename to analysis/xnlp/__init__.py diff --git a/xnlp/interpret.py b/analysis/xnlp/interpret.py similarity index 100% rename from xnlp/interpret.py rename to analysis/xnlp/interpret.py diff --git a/game_project/game/migrations/0021_auto_20200730_1913.py b/game_project/game/migrations/0021_auto_20200730_1913.py new file mode 100644 index 0000000..529ead2 --- /dev/null +++ b/game_project/game/migrations/0021_auto_20200730_1913.py @@ -0,0 +1,20 @@ +# Generated by Django 3.0.5 on 2020-07-30 19:13 + +import datetime +from django.db import migrations, models +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('game', '0020_auto_20200620_1135'), + ] + + operations = [ + migrations.AlterField( + model_name='activity', + name='created_at', + field=models.DateTimeField(default=datetime.datetime(2020, 7, 30, 19, 13, 40, 289601, tzinfo=utc)), + ), + ] diff --git a/game_project/game/migrations/0022_auto_20200731_1330.py b/game_project/game/migrations/0022_auto_20200731_1330.py new file mode 100644 index 0000000..076b3c6 --- /dev/null +++ b/game_project/game/migrations/0022_auto_20200731_1330.py @@ -0,0 +1,20 @@ +# Generated by Django 3.0.5 on 2020-07-31 13:30 + +import datetime +from django.db import migrations, models +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('game', '0021_auto_20200730_1913'), + ] + + operations = [ + migrations.AlterField( + model_name='activity', + name='created_at', + field=models.DateTimeField(default=datetime.datetime(2020, 7, 31, 13, 30, 4, 504656, tzinfo=utc)), + ), + ] diff --git a/game_project/game/migrations/0023_auto_20200731_1331.py b/game_project/game/migrations/0023_auto_20200731_1331.py new file mode 100644 index 0000000..f0805d3 --- /dev/null +++ b/game_project/game/migrations/0023_auto_20200731_1331.py @@ -0,0 +1,19 @@ +# Generated by Django 3.0.5 on 2020-07-31 13:31 + +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + + dependencies = [ + ('game', '0022_auto_20200731_1330'), + ] + + operations = [ + migrations.AlterField( + model_name='activity', + name='created_at', + field=models.DateTimeField(default=django.utils.timezone.now), + ), + ] diff --git a/game_project/game/models.py b/game_project/game/models.py index 78f6256..1bc7a56 100644 --- a/game_project/game/models.py +++ b/game_project/game/models.py @@ -24,7 +24,7 @@ class Question(models.Model): class Activity(models.Model): question = models.ForeignKey(Question, on_delete=models.CASCADE) - created_at = models.DateTimeField(default=timezone.now()) + created_at = models.DateTimeField(default=timezone.now) name = models.CharField(max_length=10) # INDECISIVE, SEPARATE, ADJACENT, SKIP, REPORT diff --git a/game_project/game/static/game/main.css b/game_project/game/static/game/main.css index f8230e6..ce6a33d 100644 --- a/game_project/game/static/game/main.css +++ b/game_project/game/static/game/main.css @@ -88,6 +88,16 @@ a.article-title:hover { position:relative; } +.textdiv textarea { + width: 80%; + font-size:2vh; +} + +.reportForm button { + background-color: #f73106; + color: white; +} + .textbutton{ background-color: #f73106 ; color: white; diff --git a/game_project/game/templates/game/answer.html b/game_project/game/templates/game/answer.html index 1aae06f..3224f3b 100644 --- a/game_project/game/templates/game/answer.html +++ b/game_project/game/templates/game/answer.html @@ -806,15 +806,6 @@

{{question_idx}}/{{QUESTION_PER_TEST}}:

Sonraki cümleye geç - -

diff --git a/game_project/game/templates/game/base.html b/game_project/game/templates/game/base.html index 6c982a5..9226480 100644 --- a/game_project/game/templates/game/base.html +++ b/game_project/game/templates/game/base.html @@ -27,6 +27,16 @@ gtag('js', new Date()); gtag('config', 'UA-170798910-2'); + + + @@ -40,7 +50,7 @@ - -

diff --git a/game_project/game/templates/game/welcome.html b/game_project/game/templates/game/welcome.html index 83215b9..ba1298b 100644 --- a/game_project/game/templates/game/welcome.html +++ b/game_project/game/templates/game/welcome.html @@ -15,7 +15,7 @@

Hoş Geldiniz

Araştırma ekibimiz tarafından Boğaziçi Üniversitesi Bilgisayar Mühendisliği çatısı altında yapay zeka yöntemleri kullanarak "de/da" yazım hatalarını tespit eden bir bilgisayar uygulaması geliştirilmişti. Şimdi ise "de/da" yazım hatalarının doğasını ve geliştirdiğimiz uygulamanın kararlarını daha iyi anlamak amacıyla bir deney yapıyoruz. - İsterseniz deneyimize katılmadan önce "-de/-da Yazım Hatası Bulucu" sayfasında geliştirdiğimiz uygulamayı deneyebilirsiniz. + İsterseniz deneyimize katılmadan önce "-de/-da Yazım Hatası Bulucu" sayfasında geliştirdiğimiz uygulamayı deneyebilirsiniz. Eğer daha önce kayıt olmadıysanız kayıt olarak deneye başlayabilir, eğer kayıt olmuşsanız giriş yaparak deneye kaldığınız yerden devam edebilirsiniz. diff --git a/game_project/game_project/settings.py b/game_project/game_project/settings.py index afa9fd8..3657346 100644 --- a/game_project/game_project/settings.py +++ b/game_project/game_project/settings.py @@ -28,7 +28,7 @@ SECRET_KEY = config['SECRET_KEY'] # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = False +DEBUG = bool(os.environ["DEBUG"]) if "DEBUG" in os.environ else False ADMINS = [('Hasan', 'hasan.ozturk2398@hotmail.com'),] @@ -151,4 +151,6 @@ MESSAGE_TAGS = { messages.ERROR: 'danger', -} \ No newline at end of file +} + +DOMAIN_NAME = 'dedatakintisi.derlem.com' \ No newline at end of file diff --git a/game_project/spellchecker/forms.py b/game_project/spellchecker/forms.py index 9461bca..3f561af 100644 --- a/game_project/spellchecker/forms.py +++ b/game_project/spellchecker/forms.py @@ -3,8 +3,9 @@ class QueryForm(forms.Form): sentence = forms.CharField(max_length=500) + is_error_found = forms.BooleanField(required=False) + tagged_string = forms.TextInput() class QueryFeedbackForm(forms.Form): - #isHappy = forms.BooleanField(required = False) report = forms.CharField(max_length=1000) \ No newline at end of file diff --git a/game_project/spellchecker/migrations/0005_auto_20200730_1913.py b/game_project/spellchecker/migrations/0005_auto_20200730_1913.py new file mode 100644 index 0000000..270f03d --- /dev/null +++ b/game_project/spellchecker/migrations/0005_auto_20200730_1913.py @@ -0,0 +1,23 @@ +# Generated by Django 3.0.5 on 2020-07-30 19:13 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('spellchecker', '0004_auto_20200531_0903'), + ] + + operations = [ + migrations.AddField( + model_name='query', + name='tagged_sentence', + field=models.TextField(default=''), + ), + migrations.AlterField( + model_name='query', + name='sentence', + field=models.TextField(default=''), + ), + ] diff --git a/game_project/spellchecker/migrations/0006_feedback.py b/game_project/spellchecker/migrations/0006_feedback.py new file mode 100644 index 0000000..f5bcea6 --- /dev/null +++ b/game_project/spellchecker/migrations/0006_feedback.py @@ -0,0 +1,22 @@ +# Generated by Django 3.0.5 on 2020-07-31 13:30 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('spellchecker', '0005_auto_20200730_1913'), + ] + + operations = [ + migrations.CreateModel( + name='Feedback', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('report', models.TextField(null=True)), + ('query', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='spellchecker.Query')), + ], + ), + ] diff --git a/game_project/spellchecker/migrations/0007_auto_20200731_1638.py b/game_project/spellchecker/migrations/0007_auto_20200731_1638.py new file mode 100644 index 0000000..73d1977 --- /dev/null +++ b/game_project/spellchecker/migrations/0007_auto_20200731_1638.py @@ -0,0 +1,23 @@ +# Generated by Django 3.0.5 on 2020-07-31 16:38 + +from django.db import migrations, models +import uuid + + +class Migration(migrations.Migration): + + dependencies = [ + ('spellchecker', '0006_feedback'), + ] + + operations = [ + migrations.RemoveField( + model_name='query', + name='isHappy', + ), + migrations.AddField( + model_name='query', + name='random_id', + field=models.UUIDField(db_index=True, default=uuid.uuid4, editable=False), + ), + ] diff --git a/game_project/spellchecker/models.py b/game_project/spellchecker/models.py index 9785648..f415ce4 100644 --- a/game_project/spellchecker/models.py +++ b/game_project/spellchecker/models.py @@ -1,8 +1,19 @@ +import uuid + from django.db import models from django.contrib.auth.models import User + class Query(models.Model): - sentence = models.TextField() - isHappy = models.BooleanField( blank=True, null=True) - user = models.ForeignKey(User, blank=True, null=True, on_delete=models.CASCADE) \ No newline at end of file + sentence = models.TextField(default="") + user = models.ForeignKey(User, blank=True, null=True, on_delete=models.CASCADE) + tagged_sentence = models.TextField(default="") + + random_id = models.UUIDField(db_index=True, default=uuid.uuid4, editable=False) + + +class Feedback(models.Model): + + query = models.ForeignKey(Query, on_delete=models.DO_NOTHING) + report = models.TextField(null=True) diff --git a/game_project/spellchecker/templates/spellchecker/spellchecker_answer.html b/game_project/spellchecker/templates/spellchecker/spellchecker_answer.html deleted file mode 100644 index 1614f27..0000000 --- a/game_project/spellchecker/templates/spellchecker/spellchecker_answer.html +++ /dev/null @@ -1,99 +0,0 @@ -{% extends 'game/base.html' %} -{% load static %} -{% block content %} - - -
- -

-de/-da Yazım Hatası Bulucu

- -
-
- -
- - {% for entry in labeled_words %} - - {% if entry.label == True %} - - {{entry.word}} - - {% else %} - - {{entry.word}} - - {% endif %} - - {% endfor %} - -
- -
- -
- - {% if is_error_found %} - - {% else %} - -

Hata bulunamadı.

- - - {% endif %} - -
- -
- -
- Başka bir cümle dene -
- -
-
- -
- - -
- - - -
- - - -{% endblock content %} diff --git a/game_project/spellchecker/templates/spellchecker/spellchecker_query.html b/game_project/spellchecker/templates/spellchecker/spellchecker_query.html index faadf73..711a527 100644 --- a/game_project/spellchecker/templates/spellchecker/spellchecker_query.html +++ b/game_project/spellchecker/templates/spellchecker/spellchecker_query.html @@ -1,7 +1,9 @@ {% extends 'game/base.html' %} {% load crispy_forms_tags %} +{% load global_information_tags %} + {% block content %} - +
@@ -10,18 +12,98 @@

-de/-da Yazım Hatası Bulucu



-
- {% csrf_token %} + {% if labeled_words %} +
+ + {% for entry in labeled_words %} + + {% if entry.label == True %} + + {{entry.word}} + + {% else %} + + {{entry.word}} + + {% endif %} + + {% endfor %} + +
+ +
+ +
+ + {% if is_error_found %} + + {% else %} + +

Hata bulunamadı.

+ + + {% endif %} + +
- +
- + + + -
-
+
-

-
+
+ Başka bir cümle dene +
+ +
+
+ +
+ + +
+ + + + + {% else %} + +
+ {% csrf_token %} + + + + + +
+
+ +

+
+ + {% endif %}
@@ -35,7 +117,7 @@

-de/-da Yazım Hatası Bulucu

- + - +