This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| اسکریپت بازسازی کامل دیتابیس | |
| """ | |
| from db import create_tables, test_connection | |
| from excel_to_qa import process_all_excel_files | |
| import config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from db import get_session, UserQuery | |
| import pandas as pd | |
| from datetime import datetime, timedelta | |
| def analyze_unanswered_queries(days_back=30): | |
| """تحلیل سوالات بدون پاسخ یا با امتیاز پایین""" | |
| session = get_session() | |
| try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| import os | |
| from datetime import datetime | |
| import arabic_reshaper | |
| from bidi.algorithm import get_display | |
| import config | |
| from db import get_session, QAPair | |
| import re | |
| from openpyxl.styles import Font, PatternFill, Alignment, Border, Side |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sqlalchemy import create_engine, Column, Integer, String, Text, DateTime, Float, LargeBinary, distinct, func, \ | |
| inspect, text | |
| from sqlalchemy.orm import declarative_base, sessionmaker, scoped_session | |
| from sqlalchemy.sql import func as sql_func | |
| import config | |
| import numpy as np | |
| from contextlib import contextmanager | |
| import pymysql | |
| import hashlib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| import re | |
| import os | |
| from pathlib import Path | |
| from db import create_tables, get_session, QAPair, FileRecord | |
| import numpy as np | |
| from datetime import datetime | |
| import hashlib | |
| # اضافه کردن دیکشنری نگاشت واحدها در ابتدای فایل (بعد از SPECIAL_LOCATIONS) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import Flask, request, render_template, redirect, url_for, flash, jsonify | |
| import os | |
| import pandas as pd | |
| from db import create_tables, get_stats | |
| import config | |
| app = Flask(__name__) | |
| app.secret_key = os.urandom(24) | |
| app.config['UPLOAD_FOLDER'] = config.EXCEL_DIR | |
| app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024 # 16MB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| from transformers import AutoTokenizer, AutoModel | |
| import torch | |
| import os | |
| import re | |
| import hashlib | |
| from typing import List, Tuple, Optional | |
| from db import get_session, close_session, QAPair, UserQuery | |
| from telebot import types |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import threading | |
| import time | |
| from admin_ui import app as admin_app | |
| from bot_app import bot | |
| from db import create_tables, get_stats, test_connection | |
| import config | |
| import os | |
| def run_admin(): |