-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #191 from EricFillion/v2
Version 2.0.0!
- Loading branch information
Showing
65 changed files
with
1,900 additions
and
2,874 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
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,3 @@ | ||
context,question | ||
October 31st is the date,what is the date? | ||
The date is November 23rd ,what is the date? |
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,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 |
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,7 @@ | ||
text | ||
Wow what a great place to eat | ||
Soooo good | ||
Okay place | ||
Pretty average | ||
Horrible food | ||
Yuck |
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,5 @@ | ||
text | ||
Wow what a great place to eat | ||
Horrible food | ||
Terrible service | ||
yum yum I'm coming here again |
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,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 |
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,5 @@ | ||
text,label | ||
Wow what a great place to eat,1 | ||
Horrible food,0 | ||
Terrible service,0 | ||
I'm coming here again,1 |
This file was deleted.
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
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() |
Oops, something went wrong.