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

Custom Model API & Custom Dataset #729

Open
saadat-r-ahmed opened this issue Apr 19, 2023 · 1 comment
Open

Custom Model API & Custom Dataset #729

saadat-r-ahmed opened this issue Apr 19, 2023 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@saadat-r-ahmed
Copy link

I tried to attack a custom sentiment classification model, pysentimiento with a custom dataset, in a csv file.

The model provides a API to make prediction:

from pysentimiento import create_analyzer
analyzer = create_analyzer(task="sentiment", lang="es")

analyzer.predict("Qué gran jugador es Messi")
# returns AnalyzerOutput(output=POS, probas={POS: 0.998, NEG: 0.002, NEU: 0.000})

The dataset is in a .csv format with the columns: "text", "label"

Can help me with the procedure to attack in such a case?
How should I generate a attack report in this case?

@jxmorris12 jxmorris12 added the documentation Improvements or additions to documentation label May 11, 2023
@jxmorris12
Copy link
Collaborator

You need to write a custom model wrapper, kind of like this one: https://github.com/QData/TextAttack/blob/master/examples/attack/attack_camembert.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants