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

Fixed a bug in the allennlp tutorial #546

Merged
merged 2 commits into from
Oct 17, 2021
Merged

Fixed a bug in the allennlp tutorial #546

merged 2 commits into from
Oct 17, 2021

Conversation

donggrant
Copy link

What does this PR do?

Fixes a small bug in tutorial 7 where the user is asked to try textattack on an AllenNLP model.

Summary

This PR changes a line of code in the call function. Originally, "self.model.predict(sentence=text_input)" throws an error that notifies the user that "BasicClassifier" does not have attribute "predict". Under further examination, self.predictor actually contains the "predict" attribute, not self.model, which was assigned self.predictor._model.

Additions

Changes

  • "self.model.predict()" in call function of class AllenNLPModel was changed to "self.predictor.predict()"

Deletions

Checklist

  • [ ] The title of your pull request should be a summary of its contribution.
  • [ ] Please write detailed description of what parts have been newly added and what parts have been modified. Please also explain why certain changes were made.
  • [ ] If your pull request addresses an issue, please mention the issue number in the pull request description to make sure they are linked (and people consulting the issue know you are working on it)
  • [ ] To indicate a work in progress please mark it as a draft on Github.
  • [ ] Make sure existing tests pass.
  • [ ] Add relevant tests. No quality testing = no merge.
  • [ ] All public methods must have informative docstrings that work nicely with sphinx. For new modules/files, please add/modify the appropriate .rst file in TextAttack/docs/apidoc.'

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@jxmorris12
Copy link
Collaborator

Thanks @donggrant! (The diff should be one line, but notebook diffs are annoying like that.)

@jxmorris12 jxmorris12 merged commit 1811105 into QData:master Oct 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants