Change to TemplateNLG

This commit is contained in:
PawelDopierala 2024-06-04 13:07:41 +02:00
parent 99306f0532
commit 893733025b
2 changed files with 3 additions and 2 deletions

View File

@ -42,5 +42,5 @@ class MachineLearningNLG:
# Przykład użycia
if __name__ == "__main__":
nlg = MachineLearningNLG()
system_act = "inform(people.kids.ages=[4,9])"
system_act = "inform(hotel='Four Seasons Hotel')"
print(nlg.nlg(system_act))

View File

@ -3,13 +3,14 @@ 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 = MachineLearningNLG()
nlg = TemplateNLG(is_user=False)
agent = PipelineAgent(nlu=nlu, dst=dst, policy=policy, nlg=nlg, name='sys')
response = agent.response(text)