| import os |
| from collections import Counter |
| import streamlit as st |
| import pandas as pd |
|
|
| |
| |
|
|
| |
| folder_path = "/home/caimera-prod/Paid-data" |
|
|
| if folder_path: |
| |
| tag_counter = Counter() |
|
|
| |
| for file_name in os.listdir(folder_path): |
| if file_name.endswith('.txt'): |
| file_path = os.path.join(folder_path, file_name) |
| with open(file_path, 'r') as file: |
| tags = file.read().strip().split(',') |
| |
| tags = [tag.strip().lower() for tag in tags] |
| tag_counter.update(tags) |
|
|
| |
| tag_data = pd.DataFrame(tag_counter.items(), columns=['Tag', 'Count']) |
| tag_data = tag_data.sort_values(by='Count', ascending=False).reset_index(drop=True) |
|
|
| |
| st.subheader('Tag Frequency Table') |
| st.table(tag_data) |
|
|
|
|