human/test/test_nlp_only.py

26 lines
455 B
Python
Raw Normal View History

2024-10-13 14:49:17 +00:00
#encoding = utf8
import time
from nlp import PunctuationSplit, DouBao
def main():
print("Started! Please speak")
split = PunctuationSplit()
nlp = DouBao(split)
nlp.ask('你好')
nlp.ask('你是谁')
nlp.ask('能做什么')
nlp.stop()
2024-10-14 10:20:55 +00:00
print("stop")
2024-10-13 14:49:17 +00:00
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
print("\nCaught Ctrl + C. Exiting")
2024-10-14 10:20:55 +00:00
except Exception as e:
print(e)