Dodanie makiety analizatora języka naturalnego

This commit is contained in:
s495728 2024-04-30 23:08:28 +02:00
parent cc74e9e838
commit cec4f7da50

View File

@ -0,0 +1,18 @@
class NaturalLanguageUnderstanding:
dictionary = {
"Cześć," : "welcomemsg()",
"imię?" : "request(name)"
}
def convertTextToFrame(self, text: str):
frame = ""
text = text.split(" ")
for word in text:
if(word in self.dictionary):
frame+=self.dictionary[word]+"&"
return frame[0:-1]
naturalLanguageUnderstanding = NaturalLanguageUnderstanding()
print(naturalLanguageUnderstanding.convertTextToFrame("Cześć, jak masz na imię?"))