Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModelInteractionEvaluation Project Type #34

Merged
merged 2 commits into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions backend/dataset/migrations/0048_auto_20240219_0524.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Generated by Django 3.2.14 on 2024-02-19 05:24

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


class Migration(migrations.Migration):
dependencies = [
("dataset", "0047_alter_instruction_meta_info_language"),
]

operations = [
migrations.AddField(
model_name="promptanswer",
name="eval_form_output_json",
field=models.JSONField(
blank=True,
help_text="Form output of the prompt response (JSON)",
null=True,
verbose_name="evaluation_form_output",
),
),
migrations.AddField(
model_name="promptanswer",
name="eval_output_likert_score",
field=models.IntegerField(
blank=True,
help_text="Rating of the prompt response",
null=True,
verbose_name="evaluation_prompt_response_rating",
),
),
migrations.AddField(
model_name="promptanswer",
name="eval_time_taken",
field=models.FloatField(
blank=True,
help_text="Time taken to complete the prompt response",
null=True,
verbose_name="evaluation_time_taken",
),
),
migrations.AddField(
model_name="promptanswer",
name="interaction_id",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
to="dataset.interaction",
),
),
]
21 changes: 21 additions & 0 deletions backend/dataset/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,9 @@ class PromptAnswer(DatasetBase):
Dataset for storing prompt response data
"""

interaction_id = models.ForeignKey(
Interaction, on_delete=models.CASCADE, null=True, blank=True
)
prompt = models.TextField(
verbose_name="prompt",
null=True,
Expand All @@ -788,6 +791,24 @@ class PromptAnswer(DatasetBase):
language = models.CharField(
verbose_name="language", choices=LANG_CHOICES, max_length=15
)
eval_output_likert_score = models.IntegerField(
verbose_name="evaluation_prompt_response_rating",
null=True,
blank=True,
help_text=("Rating of the prompt response"),
)
eval_form_output_json = models.JSONField(
verbose_name="evaluation_form_output",
null=True,
blank=True,
help_text=("Form output of the prompt response (JSON)"),
)
eval_time_taken = models.FloatField(
verbose_name="evaluation_time_taken",
null=True,
blank=True,
help_text=("Time taken to complete the prompt response"),
)

def __str__(self):
return str(self.id)
Expand Down
25 changes: 25 additions & 0 deletions backend/projects/migrations/0055_alter_project_project_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 3.2.14 on 2024-02-19 05:24

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("projects", "0054_alter_project_project_type"),
]

operations = [
migrations.AlterField(
model_name="project",
name="project_type",
field=models.CharField(
choices=[
("ModelOutputEvaluation", "ModelOutputEvaluation"),
("ModelInteractionEvaluation", "ModelInteractionEvaluation"),
("InstructionDrivenChat", "InstructionDrivenChat"),
],
help_text="Project Type indicating the annotation task",
max_length=100,
),
),
]
19 changes: 19 additions & 0 deletions backend/projects/project_registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,25 @@ ModelOutputEvaluation:
- form_output_json
- output_likert_score
- time_taken
ModelInteractionEvaluation:
input_dataset:
class: Interaction
fields:
- id
- interactions_json
- no_of_turns
- model
- language
output_dataset:
class: PromptAnswer
save_type: new_record
fields:
copy_from_input:
id: interaction_id
annotations:
- eval_form_output_json
- eval_output_likert_score
- eval_time_taken
Chat:
description: "Instruction Driven Chat"
project_types:
Expand Down
Loading