Skip to content

Commit

Permalink
Merge pull request #191 from EricFillion/v2
Browse files Browse the repository at this point in the history
Version 2.0.0!
  • Loading branch information
EricFillion committed Jan 13, 2021
2 parents d7eefb9 + 5ce9961 commit 16ca528
Show file tree
Hide file tree
Showing 65 changed files with 1,900 additions and 2,874 deletions.
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
examples/question_answering/train.csv
examples/question_answering/eval.csv
examples/text_classification/train.csv
examples/text_classification/eval.csv
runs/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -126,4 +132,6 @@ venv.bak/
dmypy.json

# Pyre type checker
.pyre/
.pyre/

.vscode/settings.json
934 changes: 421 additions & 513 deletions README.md

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions data/qa/test.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
context,question
October 31st is the date,what is the date?
The date is November 23rd ,what is the date?
3 changes: 3 additions & 0 deletions data/qa/train-eval.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
context,question,answer_text,answer_start
October 31st is the date,what is the date?,October 31st,0
The date is November 23rd ,what is the date?,November 23rd,12
7 changes: 7 additions & 0 deletions data/tc/test-multi.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
text
Wow what a great place to eat
Soooo good
Okay place
Pretty average
Horrible food
Yuck
5 changes: 5 additions & 0 deletions data/tc/test.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
text
Wow what a great place to eat
Horrible food
Terrible service
yum yum I'm coming here again
7 changes: 7 additions & 0 deletions data/tc/train-eval-multi.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
text,label
Wow what a great place to eat,2
Soooo good,2
Okay place,1
Pretty average,1
Horrible food,0
Yuck,0
5 changes: 5 additions & 0 deletions data/tc/train-eval.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
text,label
Wow what a great place to eat,1
Horrible food,0
Terrible service,0
I'm coming here again,1
259 changes: 0 additions & 259 deletions examples/Finetuning HappyROBERTA.ipynb

This file was deleted.

32 changes: 32 additions & 0 deletions examples/next_sentence_prediction/readme_examples.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from happytransformer import HappyNextSentence

def example_4_0():
happy_ns = HappyNextSentence() # default is "bert-base-uncased"
happy_ns_large = HappyNextSentence("BERT", "bert-large-uncased")


def example_4_1():
happy_ns = HappyNextSentence()
result = happy_ns.predict_next_sentence(
"How old are you?",
"I am 21 years old."
)
print(type(result)) # <class 'float'>
print(result) # 0.9999918937683105

def example_4_2():
happy_ns = HappyNextSentence()
result = happy_ns.predict_next_sentence(
"How old are you?",
"Queen's University is in Kingston Ontario Canada"
)
print(type(result)) # <class 'float'>
print(result) # 0.00018497584096621722


def main():
example_4_2()


if __name__ == "__main__":
main()
Loading

0 comments on commit 16ca528

Please sign in to comment.