25 lines
432 B
Python
25 lines
432 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('能做什么')
|
||
|
time.sleep(20)
|
||
|
print("Stop! ")
|
||
|
nlp.stop()
|
||
|
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
try:
|
||
|
main()
|
||
|
except KeyboardInterrupt:
|
||
|
print("\nCaught Ctrl + C. Exiting")
|