Created
August 19, 2023 11:28
-
-
Save hadifar/b0761d78141ee911054c17a649e9b775 to your computer and use it in GitHub Desktop.
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
from transformers import pipeline | |
classifier = pipeline("text-classification", model="hadifar/xxx") | |
try: | |
while True: | |
user_input = input("Enter a string (Press Ctrl+C to stop): ") | |
if user_input: | |
res = classifier([user_input]) | |
print(res) | |
except KeyboardInterrupt: | |
print("\nProgram stopped by the user.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment