-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an attribute extraction task (#566)
* started on the attribute extraction task * added metrics for each attribute * updated attribute extraction task with method * removed attribute extraction f1 score * added systematic approach to attribute metrics * deleted debug print * Add attribute extraction task * Allow dataset exploration with attribute extraction * Fix the case where there is no label column --------- Co-authored-by: Tyler <[email protected]> Co-authored-by: Rajas Bansal <[email protected]>
- Loading branch information
1 parent
a32d3f7
commit 328b8ac
Showing
14 changed files
with
1,276 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"task_name": "EthosAttributeExtraction", | ||
"task_type": "attribute_extraction", | ||
"dataset": { | ||
"text_column": "text", | ||
"delimiter": "," | ||
}, | ||
"model": { | ||
"provider": "openai", | ||
"name": "gpt-3.5-turbo" | ||
}, | ||
"prompt": { | ||
"task_guidelines": "You are an expert at classifying hate speech and identifying the type of hate speech. Read the following tweets and extract the following attributes from the text.", | ||
"attributes": [ | ||
{ | ||
"name": "violence", | ||
"options": ["not_violent", "violent"], | ||
"description": "If the tweet mentions violence towards a person or a group." | ||
}, | ||
{ | ||
"name": "directed_vs_generalized", | ||
"options": [ | ||
"generalized", | ||
"directed" | ||
], | ||
"description": "If the hate speech is generalized towards a group or directed towards a specific person." | ||
}, | ||
{ | ||
"name": "gender", | ||
"options": [ | ||
"true", | ||
"false" | ||
], | ||
"description": "If the hate speech uses gendered language and attacks a particular gender." | ||
} | ||
], | ||
"few_shot_examples": "seed.csv", | ||
"few_shot_selection": "fixed", | ||
"few_shot_num": 5, | ||
"example_template": "Text: {text}\nOutput: {output_dict}" | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.