human/test/test_nlp_only.py
2024-10-14 18:20:55 +08:00

26 lines
455 B
Python

#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()
print("stop")
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
print("\nCaught Ctrl + C. Exiting")
except Exception as e:
print(e)