Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
evoprompt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Grießhaber Daniel
evoprompt
Commits
e7e571d9
Commit
e7e571d9
authored
7 months ago
by
Max Kimmich
Browse files
Options
Downloads
Patches
Plain Diff
Fix SST2 dataset
parent
b607b76a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
evoprompt/task/sentiment_analysis.py
+14
-4
14 additions, 4 deletions
evoprompt/task/sentiment_analysis.py
with
14 additions
and
4 deletions
evoprompt/task/sentiment_analysis.py
+
14
−
4
View file @
e7e571d9
...
...
@@ -64,16 +64,26 @@ class SST2(SentimentAnalysis):
):
return
load_dataset
(
"
csv
"
,
data_files
=
{
"
validation
"
:
"
evoprompt/data/sst-2/train.
c
sv
"
},
data_files
=
{
"
validation
"
:
"
evoprompt/data/sst-2/train.
t
sv
"
},
split
=
"
validation
"
,
sep
=
"
\t
"
,
)
def
load_test_set
(
self
,
test_dataset
:
str
,
test_split
:
str
|
None
):
return
load_dataset
(
"
csv
"
,
data_files
=
{
"
test
"
:
"
evoprompt/data/sst-2/dev.csv
"
},
# this dataset is not in correct format therefore we process it after reading as a simple text file
dataset
=
load_dataset
(
"
text
"
,
data_files
=
{
"
test
"
:
"
evoprompt/data/sst-2/test.tsv
"
},
split
=
"
test
"
,
)
dataset
=
dataset
.
map
(
lambda
sample
:
{
"
label
"
:
int
(
sample
[
"
text
"
][
0
]),
"
sentence
"
:
sample
[
"
text
"
][
2
:],
},
remove_columns
=
"
text
"
,
)
return
dataset
def
_get_text_for_datum
(
self
,
datum
:
DatasetDatum
)
->
str
:
return
datum
[
"
sentence
"
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment