common -> app.common.

This commit is contained in:
hsafaei
2025-09-18 14:32:19 +03:30
parent a507fff651
commit b4d5671809
83 changed files with 192 additions and 163 deletions
+23
View File
@@ -0,0 +1,23 @@
from app.common.config_base import *
from app.common.general_functions import *
import requests
url = " https://tavasi.ir/api/nlp/keywords?content="
headers = HEADERS
text = '''
دیپلماسی اقتصادی: مجموعه اقدامات و فعالیت های اقتصادی خارجی (توسط دولت یا بخش خصوصی با هماهنگی وزارت امورخارجه) که با هدف توسعه روابط اقتصادی و تجاری با کشورهای خارجی، در جهت دستیابی به اهداف نظیر افزایش دسترسی به بازارهای بین المللی کالاها و خدمات، سرمایه گذاری خارجی، تبادل فناوری و برقراری روابط پایدار با سایر کشورها انجام می شود.
'''
url = url + text
payload = {}
response = requests.request("GET", url, headers=headers, data=payload)
entities = ''
i = len(response.text.strip())-3
keywords = response.text[13:i].split(',')
# for entity in keywords:
# entities = entities + str(entity).strip('\"') +' ' + '\n'
print(keywords)