GOATS/NaturalLanguageGeneration.py
2024-04-23 00:26:55 +02:00

13 lines
330 B
Python

import re
class NaturalLanguageGeneration:
def nlg(self, system_act):
response = None
pattern = r'inform\(name=([^\)]+)\)'
matching = re.search(pattern, system_act)
if matching:
name = matching.group(1)
response = f"Witaj, nazywam się {name}"
return response