18 lines
738 B
Python
18 lines
738 B
Python
from NaturalLanguageAnalyzer import NaturalLanguageAnalyzer
|
|
from DialoguePolicy import DialoguePolicy
|
|
from DialogueStateTracker import DialogueStateTracker
|
|
from convlab.dialog_agent import PipelineAgent
|
|
from MachineLearningNLG import MachineLearningNLG # Importujemy nowy komponent NLG
|
|
from convlab.nlg.template.multiwoz import TemplateNLG
|
|
|
|
if __name__ == "__main__":
|
|
text = "chciałbym zarezerwować drogi hotel z parkingiem 1 stycznia w Warszawie w centrum"
|
|
nlu = NaturalLanguageAnalyzer()
|
|
dst = DialogueStateTracker()
|
|
policy = DialoguePolicy()
|
|
nlg = TemplateNLG(is_user=False)
|
|
|
|
agent = PipelineAgent(nlu=nlu, dst=dst, policy=policy, nlg=nlg, name='sys')
|
|
response = agent.response(text)
|
|
print(response)
|