Я новичок в НЛП и в Python.Я пытаюсь использовать стандартизацию объектов, чтобы заменить сокращения их полным значением.Я нашел код в Интернете и изменил его, чтобы проверить его на сайте Википедии.но все, что делает код, это распечатывает оригинальный текст.Может ли кто-нибудь выручить нуждающегося новичка?
вот код:
import nltk
lookup_dict = {'EC': 'European Commission', 'EU': 'European Union', "ECSC": "European Coal and Steel Commuinty",
"EEC": "European Economic Community"}
def _lookup_words(input_text):
words = input_text.split()
new_words = []
for word in words:
if word.lower() in lookup_dict:
word = lookup_dict[word.lower()]
new_words.append(word)
new_text = " ".join(new_words)
print(new_text)
return new_text
_lookup_words(
"The High Authority was the supranational administrative executive of the new European Coal and Steel Community ECSC. It took office first on 10 August 1952 in Luxembourg. In 1958, the Treaties of Rome had established two new communities alongside the ECSC: the eec and the European Atomic Energy Community (Euratom). However their executives were called Commissions rather than High Authorities")
Заранее спасибо, любая помощь приветствуется!