2024-04-17 19:35:47 +02:00
|
|
|
from NaturalLanguageAnalyzer import NaturalLanguageAnalyzer
|
2024-04-21 10:09:03 +02:00
|
|
|
from DialoguePolicy import DialoguePolicy
|
2024-05-27 21:50:25 +02:00
|
|
|
from DialogueStateTracker import DialogueStateTracker
|
2024-06-07 00:38:21 +02:00
|
|
|
from NaturalLanguageGeneration import NaturalLanguageGeneration
|
2024-05-27 21:50:25 +02:00
|
|
|
from convlab.dialog_agent import PipelineAgent
|
2024-06-07 00:38:21 +02:00
|
|
|
import warnings
|
|
|
|
warnings.filterwarnings("ignore")
|
2024-06-04 21:53:50 +02:00
|
|
|
|
|
|
|
|
2024-04-17 19:35:47 +02:00
|
|
|
if __name__ == "__main__":
|
2024-05-27 21:50:25 +02:00
|
|
|
nlu = NaturalLanguageAnalyzer()
|
|
|
|
dst = DialogueStateTracker()
|
|
|
|
policy = DialoguePolicy()
|
2024-06-07 00:38:21 +02:00
|
|
|
nlg = NaturalLanguageGeneration()
|
2024-04-21 10:09:03 +02:00
|
|
|
|
2024-05-27 21:50:25 +02:00
|
|
|
agent = PipelineAgent(nlu=nlu, dst=dst, policy=policy, nlg=nlg, name='sys')
|
2024-06-07 00:38:21 +02:00
|
|
|
|
|
|
|
print("Witam, jestem systemem do rezerwowania pokoi hotelowych. W czym mogę Ci pomóc?")
|
|
|
|
while True:
|
|
|
|
text = input()
|
|
|
|
response = agent.response(text)
|
|
|
|
print(response)
|