Linux 45-56-67-123 5.14.0-503.16.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Dec 13 01:47:05 EST 2024 x86_64
Apache/2.4.62 (AlmaLinux) OpenSSL/3.2.2
: 45.56.67.123 | : 52.15.253.72
Cant Read [ /etc/named.conf ]
8.3.15
apache
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
afra /
py.afaa.website /
[ HOME SHELL ]
Name
Size
Permission
Action
.vscode
[ DIR ]
drwxr-xr-x
__pycache__
[ DIR ]
drwxr-xr-x
explore
[ DIR ]
drwxr-xr-x
mara1_model
[ DIR ]
drwxr-xr-x
nltk_data
[ DIR ]
drwxr-xr-x
pythainlp_data
[ DIR ]
drwxr-xr-x
runs
[ DIR ]
drwxr-xr-x
venv
[ DIR ]
drwxr-xr-x
yolo8
[ DIR ]
drwxr-xr-x
. htaccess
417
B
-rwxr-xr-x
.htaccess
197
B
-rwxr-xr-x
app.log
66
B
-rwxr-xr-x
app.py
16.16
KB
-rwxr-xr-x
app.wsgi
568
B
-rwxr-xr-x
blog_ttt_website.py
5.07
KB
-rwxr-xr-x
config.py
485
B
-rwxr-xr-x
content_content_image_ram.py
11.07
KB
-rw-r--r--
content_main_ram.py
15.99
KB
-rw-r--r--
detect.py
8.16
KB
-rwxr-xr-x
explore.py
11.4
KB
-rw-r--r--
json_logfile.json
18
B
-rwxr-xr-x
keywords.json
203
B
-rw-r--r--
locations.json
299
B
-rw-r--r--
read_virus_files_php.py
2.6
KB
-rwxr-xr-x
table.csv
56.2
KB
-rw-r--r--
travel.py
6.89
KB
-rw-r--r--
travel_action.py
10.72
KB
-rw-r--r--
travel_mara1.py
12.6
KB
-rw-r--r--
travel_nltk_base.py
5.21
KB
-rw-r--r--
travel_pythainlp.py
9.37
KB
-rw-r--r--
udo systemctl daemon-reload
1.07
KB
-rwxr-xr-x
udo systemctl restart apache2
1.25
KB
-rwxr-xr-x
your_flask_service.log
1.07
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : travel_nltk_base.py
# /var/www/afra/py.afaa.website/travel_nltk_base.py import nltk from nltk.tokenize import word_tokenize from nltk.corpus import stopwords from nltk.stem import PorterStemmer import os import re from collections import Counter def download_nltk_resources(): """Downloads necessary NLTK resources.""" nltk_data_path = os.path.join(os.path.dirname(__file__), 'nltk_data') if not os.path.exists(nltk_data_path): os.makedirs(nltk_data_path) # ตั้งค่าเส้นทางให้ NLTK รู้จัก os.environ['NLTK_DATA'] = nltk_data_path nltk.data.path.append(nltk_data_path) for resource in ['punkt_tab', 'stopwords']: try: # 'punkt_tab' คือ tokenizer data ของ nltk # 'stopwords' คือรายการ stopwords ภาษาอังกฤษ nltk.data.find(f'tokenizers/{resource}' if resource == 'punkt_tab' else f'corpora/{resource}') except LookupError: print(f"Downloading NLTK resource: {resource}...") nltk.download(resource, download_dir=nltk_data_path, quiet=False) download_nltk_resources() def process_text_with_nltk(text, clean_text_func, primary_lang="en"): """ Process text with NLTK and ensure no 'unknown' appears. primary_lang defaults to 'en' and can be 'th' or ''. """ # ทำความสะอาดข้อความด้วยฟังก์ชันที่รับมา cleaned_text = clean_text_func(text) if text else "" # กรณีข้อความว่าง ให้คืนผลลัพธ์โดยไม่มี "unknown" if not cleaned_text: return { "processed_text": cleaned_text, # ใช้ข้อความที่ cleaned (ว่างถ้าไม่มี) "formatted_text": "<p>" + cleaned_text.replace("\n", " ") + "</p>", "sentiment": "neutral", "processed_Keywords": [], "primary_lang": primary_lang if primary_lang in ["en", "th"] else "" # ว่างถ้าไม่ใช่ "en" หรือ "th" } # ตัดคำด้วย NLTK try: words = word_tokenize(cleaned_text) except Exception as e: print(f"Error tokenizing text: {str(e)}") return { "processed_text": cleaned_text, # ใช้ cleaned_text แทนถ้า error "formatted_text": "<p>" + cleaned_text.replace("\n", " ") + "</p>", "sentiment": "neutral", "processed_Keywords": [], "primary_lang": primary_lang if primary_lang in ["en", "th"] else "en" # ค่าเริ่มต้นเป็น "en" } # ใช้ stopwords มาตรฐานจาก NLTK stop_words = set(stopwords.words('english')) # กรองคำ: ลบ stopwords, ตัวเลข, และคำสั้น filtered_words = [ w for w in words if w.lower() not in stop_words and len(w) >= 6 # เน้นคำที่มีความยาว 6 ตัวอักษรขึ้นไป and not re.match(r'^\d+[.,]?\d*$', w) # ตัดตัวเลขออก and re.match(r'^[ก-๙a-zA-Z]+$', w) # อนุญาตเฉพาะตัวอักษรไทยและอังกฤษ ] # ใช้ PorterStemmer เพื่อลดรูปคำก่อนนับความถี่ ps = PorterStemmer() stemmed_words = [ps.stem(w.lower()) for w in filtered_words] # แปลงเป็น lowercase และ stem # คำนวณความถี่ของคำที่ถูกลดรูป word_freq = Counter(stemmed_words) # เลือกคำที่มีความถี่สูงสุด 30 คำ และตัดคำที่ความถี่ต่ำ filtered_keywords = [(w, freq) for w, freq in word_freq.items() if freq > 1] # ต้องปรากฏมากกว่า 1 ครั้ง stemmed_keywords = [w for w, _ in sorted(filtered_keywords, key=lambda x: x[1], reverse=True)][:30] # แปลง stemmed keywords กลับไปหาคำตัวแทนจาก filtered_words (เลือกคำแรกที่พบ) processed_keywords = [] used_stems = set() for stem in stemmed_keywords: for original in filtered_words: if ps.stem(original.lower()) == stem and stem not in used_stems: processed_keywords.append(original) used_stems.add(stem) break # processed_text ใช้ stemmed_words และลบ "unknown" ถ้ามี processed_text = " ".join(stemmed_words).replace("unknown", "") # สร้าง formatted_text และลบ "unknown" ถ้ามี formatted_text = "<p>" + cleaned_text.replace("\n", " ").replace("unknown", "") + "</p>" return { "processed_text": processed_text, "formatted_text": formatted_text, "sentiment": "neutral", "processed_Keywords": processed_keywords, "primary_lang": primary_lang if primary_lang in ["en", "th"] else "en" # ค่าเริ่มต้น "en" ถ้าไม่ระบุ }
Close