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
import humingbird | |
import random | |
intents = { | |
"greeting": ["Hi! Welcome to the ice cream shop.", "Welcome! What can i help you with?"], | |
"goodbye": ["Goodbye!", "Nice chatting! Have a great day."], | |
"menu": ["Here is our menu: https://www.randomicecream.co"], | |
"prices": ["Our prices our affordable for all!", "We have super low prices! Pracitcally free!"], | |
"start_order": ["Lets start the order here: https://www.fakepaymentlink.com"] | |
} |
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
import humingbird | |
prediction = humingbird.Image.predict( | |
image_path='ice-cream.jpg', | |
labels=["strawberry ice cream", "vanilla ice cream", "chocolate ice cream"] # add more if you'd like :) | |
) | |
print(prediction) |
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
import humingbird | |
import random | |
intents = { | |
"greeting": ["Hi! Welcome to the ice cream shop.", "Welcome! What can i help you with?"], | |
"goodbye": ["Goodbye!", "Nice chatting! Have a great day."], | |
"menu": ["Here is our menu: https://www.randomicecream.co"], | |
"prices": ["Our prices our affordable for all!", "We have super low prices! Pracitcally free!"], | |
"start_order": ["Lets start the order here: https://www.fakepaymentlink.com"] | |
} |
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
{ | |
"greetings": ["Hi! Welcome to the ice cream shop.", "Welcome! What can i help you with?"], | |
"goodbyes": ["Goodbye!", "Nice chatting! Have a great day."], | |
"menu": ["Here is our menu: https://www.randomicecream.co"], | |
"prices": ["Our prices our affordable for all!", "We have super low prices! Pracitcally free!"], | |
"start_order": ["Lets start the order here: https://www.fakepaymentlink.com"] | |
} |
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
import humingbird | |
intent_recognition = humingbird.Text.predict( | |
text="I was wondering what you have on your menu? I love ice cream!", | |
labels=["greeting", "goodbye", "menu", "prices", "start_order"] | |
) | |
print(intent_recognition) |
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
{ | |
"generated_text": "I am building a Humingbird app for everyone at 12:00 am, but I do it for the people of the world ....", | |
"warning": "WARNING: This output may contain sensitive or toxic text. Please use with caution." | |
} |
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
{ | |
"prompt": "I am building a Humingbird app for everyone at 12:00 am, but I do it for the" | |
} |
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
# import libraries | |
from flask import request, jsonify, Flask, abort | |
import transformers | |
from transformers import pipeline | |
import humingbird | |
# start flask app | |
app = Flask(__name__) | |
# download GPT-2/load the model |
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
import transformers | |
from transformers import pipeline | |
import humingbird | |
# load the model | |
generator = pipeline('text-generation', model='gpt2') | |
# generate a sample | |
generation = (generator("I went for a walk today and saw a", max_length=60))[0]['generated_text'] |
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
import humingbird | |
content_filter = humingbird.Text.predict( | |
text="our sample text for Humingbird! This is so easy.", | |
labels=["toxic", "not toxic"] | |
) | |
print(content_filter) |
NewerOlder