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 __future__ import annotations | |
| import json | |
| import sys | |
| import time | |
| from collections import Counter | |
| from pathlib import Path | |
| try: | |
| import gdown |
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 | |
| """ | |
| Generic PDF downloader for biblioteca-digitala.ro | |
| Works with any publication page. | |
| Usage: | |
| python download_biblioteca_digitala.py "https://biblioteca-digitala.ro/?pub=7758-revista-romana-de-sociologie" | |
| python download_biblioteca_digitala.py "https://biblioteca-digitala.ro/?pub=6464-studii-si-cercetari-de-chimie" | |
| """ |
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
| """Overlay pentru subtitrari SRT, sincronizat manual cu un film redat in browser. | |
| Pornire: dublu-click pe acest fisier sau: python subtitrare.py | |
| Apasa START exact cand pornesti/redai filmul. Foloseste -/+ pentru corectie fina. | |
| """ | |
| import ctypes | |
| import json | |
| import re | |
| import time | |
| import tkinter as tk |
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
| """Overlay pentru subtitrari SRT, sincronizat manual cu un film redat in browser. | |
| Pornire: dublu-click pe acest fisier sau: python subtitrare.py | |
| Apasa START exact cand pornesti/redai filmul. Foloseste -/+ pentru corectie fina. | |
| """ | |
| import ctypes | |
| import json | |
| import re | |
| import time | |
| import tkinter as tk |
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
| """Overlay pentru subtitrari SRT, sincronizat manual cu un film redat in browser. | |
| Pornire: dublu-click pe acest fisier sau: python subtitrare.py | |
| Apasa START exact cand pornesti/redai filmul. Foloseste -/+ pentru corectie fina. | |
| """ | |
| import ctypes | |
| import json | |
| import re | |
| import time | |
| import tkinter as tk |
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
| """Overlay pentru subtitrari SRT, sincronizat manual cu un film redat in browser. | |
| Pornire: dublu-click pe acest fisier sau: python subtitrare.py | |
| Apasa START exact cand pornesti/redai filmul. Foloseste -/+ pentru corectie fina. | |
| """ | |
| import ctypes | |
| import re | |
| import time | |
| import tkinter as tk | |
| from tkinter import ttk |
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
| """ | |
| Analiza stilistica (stilometrie): captureaza "amprenta de scris" a fiecarui autor | |
| si ii diferentiaza. NU foloseste embeddings semantice (acelea prind subiectul); | |
| foloseste trasaturi de STIL, care raman constante indiferent despre ce scrie autorul. | |
| Trei familii de trasaturi, combinate: | |
| 1. N-grame de caractere -> ortografie, morfologie, forme de epoca | |
| 2. Cuvinte-unelte -> semnatura stilistica clasica (cum leaga frazele) | |
| 3. Trasaturi structurale -> lungimea frazelor, punctuatie, diversitate lexicala |
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 os | |
| os.environ["HF_HUB_DISABLE_SYMLINKS_WARNING"] = "1" | |
| import numpy as np | |
| from sentence_transformers import SentenceTransformer | |
| from sklearn.cluster import AgglomerativeClustering | |
| model = SentenceTransformer("intfloat/multilingual-e5-base") | |
| # ---------------------------------------------------------------------- |
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
| """ | |
| Sistem RAG peste cărțile tale: transformă paragrafele în vectori, caută semantic | |
| la o întrebare modernă și generează un răspuns bazat DOAR pe textele găsite. | |
| Instalare: | |
| pip install "sentence-transformers>=3.0" "chromadb>=0.5" \ | |
| "transformers>=4.44" accelerate torch | |
| Model de embedding recomandat pentru română: intfloat/multilingual-e5-large | |
| (dacă vrei ceva mai ușor: paraphrase-multilingual-MiniLM-L12-v2) |
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
| """ | |
| Fine-tuning LoRA al unui model mic (Mistral 7B / Llama 3 8B) pe textul cărților. | |
| Rezultat: un model care scrie și folosește jargonul de epocă din cărțile tale. | |
| Instalare: | |
| pip install "transformers>=4.44" "trl>=0.9" "peft>=0.12" \ | |
| "datasets>=2.20" "bitsandbytes>=0.43" accelerate sentencepiece | |
| Rulare: | |
| python finetuning_carti.py | |
| GPU recomandat: minim ~12 GB VRAM (cu quantizare 4-bit). Fără GPU nu e practic. |
NewerOlder