Проблема с запуском python-кода с NLTK на платформе Render

У меня есть проект django, работающий на Render, и я подумываю о реализации чатбота с помощью nltk. Проблема возникает в тот момент, когда сам проект собирается запускаться. По какой-то причине он пытается получить доступ к стоп-словам несколько раз, а затем говорит, что он уже обновлен. И так продолжается без остановки.

[nltk_data] Downloading package stopwords to /opt/render/nltk_data...
[nltk_data]   Unzipping corpora/stopwords.zip.
[nltk_data] Downloading package stopwords to /opt/render/nltk_data...
[nltk_data]   Package stopwords is already up-to-date!
[nltk_data] Downloading package stopwords to /opt/render/nltk_data...
[nltk_data]   Package stopwords is already up-to-date!

Это сообщения, которые постоянно повторяются.

[nltk_data] Downloading package stopwords to /opt/render/nltk_data...
[nltk_data]   Package stopwords is already up-to-date!
[2024-04-02 16:53:45 -0400] [59] [CRITICAL] WORKER TIMEOUT (pid:60)
[2024-04-02 16:53:45 -0400] [60] [INFO] Worker exiting (pid: 60)
[2024-04-02 16:53:47 -0400] [59] [ERROR] Worker (pid:60) was sent SIGKILL! Perhaps out of memory?
[2024-04-02 16:53:47 -0400] [68] [INFO] Booting worker with pid: 68
[nltk_data] Downloading package stopwords to /opt/render/nltk_data...
[nltk_data]   Package stopwords is already up-to-date!

А вот из-за этого он снова зацикливается.

Это код из файла nltk.py, который используется файлом views.py в папке с моим чатботом. После некоторых проб и ошибок я думаю, что ошибка начинается со строки 'tags = nltk.pos_tag(words)' внутри функции extract_features. Я предполагаю, что это связано с тем, что я пытаюсь использовать nltk таким образом, но я не уверен, как это решить.

На всякий случай, я также добавлю сюда текстовый файл, который я использую:

Hey there!|Greetings|Hey there! I'm Dexcter, here to help with your leave enquiries.
Good morning!|Greetings|Good morning! Dexcter here, at your service for your leave needs.
Hey, how's it going?|Greetings|Hey, how's it going? Dexcter here, ready to assist you.
Well met!|Greetings|Well met! Dexcter here, ready to help with your leave queries.
Howdy!|Greetings|Howdy! Dexcter here, ready to help with your leave enquiries.
Hello|Greetings|Hello, I am Dexcter. I will serve your leave enquiries.
hi|Greetings|Hello, I am Dexcter. I will serve your leave enquiries.
help me|Help|How can I help you?
thank you|Closing|You are very welcome!
Farewell|Goodbye|Farewell! Feel free to reach out if you need assistance in the future.
Take care|Goodbye|Take care! If you have any more questions, don't hesitate to ask.
Until next time|Goodbye|Until next time! Have a wonderful day.
See you later|Goodbye|See you later! Don't hesitate to return if you have more inquiries.
Bye for now|Goodbye|Bye for now! Feel free to come back anytime.
Catch you later|Goodbye|Catch you later! Let me know if there's anything else I can assist you with.
Goodbye|Goodbye|Goodbye for now! If you need further assistance, don't hesitate to ask.
types of leaves?|Leaves-Type|Currently, I know only two leaves: optional and annual.
type leaves?|Leaves-Type|Currently, I know only two leaves: optional and annual.
leaves type?|Leaves-Type|Currently, I know only two leaves: optional and annual.
leaves type?|Leaves-Type|Currently, I know only two leaves: optional and annual.
how many annual leaves have I took?|Utilized-Annual-Leaves|You have used 2 annual leaves.
how many annual leaves did I take?|Utilized-Annual-Leaves|You have used 2 annual leaves.
annual leaves taken?|Utilized-Annual-Leaves|You have used 2 annual leaves.
how many optional leaves have I took?|Utilized-Optional-Leaves|You have used 2 optional leaves.
how many optional leaves did I take?|Utilized-Optional-Leaves|You have used 2 optional leaves.
optional leaves taken?|Utilized-Optional-Leaves|You have used 2 optional leaves.

Если есть кто-нибудь, кто пробовал использовать NLTK с django и с Render, пожалуйста, дайте мне знать, как я могу решить эту проблему.

Вернуться на верх