GOATS/NaturalLanguageGeneration.py

13 lines
330 B
Python
Raw Normal View History

2024-04-23 00:26:55 +02:00
import re
2024-04-21 10:09:03 +02:00
class NaturalLanguageGeneration:
def nlg(self, system_act):
response = None
2024-04-23 00:26:55 +02:00
pattern = r'inform\(name=([^\)]+)\)'
matching = re.search(pattern, system_act)
if matching:
name = matching.group(1)
2024-04-21 10:09:03 +02:00
response = f"Witaj, nazywam się {name}"
return response