Spaces:
Sleeping
Sleeping
Update backend/__init__.py
Browse files- backend/__init__.py +2 -81
backend/__init__.py
CHANGED
|
@@ -1,81 +1,2 @@
|
|
| 1 |
-
#
|
| 2 |
-
|
| 3 |
-
load_beta_matrix,
|
| 4 |
-
get_top_words_at_time,
|
| 5 |
-
get_top_words_over_time,
|
| 6 |
-
load_time_labels
|
| 7 |
-
)
|
| 8 |
-
|
| 9 |
-
from .inference.indexing_utils import load_index
|
| 10 |
-
from .inference.word_selector import (
|
| 11 |
-
get_interesting_words,
|
| 12 |
-
get_word_trend
|
| 13 |
-
)
|
| 14 |
-
from .inference.peak_detector import detect_peaks
|
| 15 |
-
from .inference.doc_retriever import (
|
| 16 |
-
load_length_stats,
|
| 17 |
-
get_yearly_counts_for_word,
|
| 18 |
-
get_all_documents_for_word_year,
|
| 19 |
-
deduplicate_docs,
|
| 20 |
-
extract_snippet,
|
| 21 |
-
highlight,
|
| 22 |
-
get_docs_by_ids,
|
| 23 |
-
)
|
| 24 |
-
|
| 25 |
-
# === LLM components ===
|
| 26 |
-
from .llm_utils.label_generator import label_topic_temporal, get_topic_labels
|
| 27 |
-
from .llm_utils.token_utils import (
|
| 28 |
-
get_token_limit_for_model,
|
| 29 |
-
count_tokens,
|
| 30 |
-
estimate_avg_tokens_per_doc,
|
| 31 |
-
estimate_max_k,
|
| 32 |
-
estimate_max_k_fast
|
| 33 |
-
)
|
| 34 |
-
from .llm_utils.summarizer import (
|
| 35 |
-
summarize_docs,
|
| 36 |
-
summarize_multiword_docs,
|
| 37 |
-
ask_multiturn_followup
|
| 38 |
-
)
|
| 39 |
-
from .llm.llm_router import (
|
| 40 |
-
list_supported_models,
|
| 41 |
-
get_llm
|
| 42 |
-
)
|
| 43 |
-
|
| 44 |
-
# === Dataset utilities ===
|
| 45 |
-
from .datasets import dynamic_dataset
|
| 46 |
-
from .datasets import preprocess
|
| 47 |
-
from .datasets.utils import logger, _utils
|
| 48 |
-
from .datasets.data import file_utils, download
|
| 49 |
-
|
| 50 |
-
# === Evaluation ===
|
| 51 |
-
from .evaluation.CoherenceModel_ttc import CoherenceModel_ttc
|
| 52 |
-
from .evaluation.eval import TopicQualityAssessor
|
| 53 |
-
|
| 54 |
-
# === Models ===
|
| 55 |
-
from .models.DETM import DETM
|
| 56 |
-
from .models.DTM_trainer import DTMTrainer
|
| 57 |
-
from .models.CFDTM.CFDTM import CFDTM
|
| 58 |
-
from .models.dynamic_trainer import DynamicTrainer
|
| 59 |
-
|
| 60 |
-
__all__ = [
|
| 61 |
-
# Inference
|
| 62 |
-
"load_beta_matrix", "load_time_labels", "get_top_words_at_time", "get_top_words_over_time",
|
| 63 |
-
"load_index", "get_interesting_words", "get_word_trend", "detect_peaks",
|
| 64 |
-
"load_length_stats", "get_yearly_counts_for_word", "get_all_documents_for_word_year",
|
| 65 |
-
"deduplicate_docs", "extract_snippet", "highlight", "get_docs_by_ids",
|
| 66 |
-
|
| 67 |
-
# LLM
|
| 68 |
-
"summarize_docs", "summarize_multiword_docs", "ask_multiturn_followup",
|
| 69 |
-
"get_token_limit_for_model", "list_supported_models", "get_llm",
|
| 70 |
-
"label_topic_temporal", "get_topic_labels", "count_tokens",
|
| 71 |
-
"estimate_avg_tokens_per_doc", "estimate_max_k", "estimate_max_k_fast",
|
| 72 |
-
|
| 73 |
-
# Dataset
|
| 74 |
-
"dynamic_dataset", "preprocess", "logger","_utils", "file_utils", "download",
|
| 75 |
-
|
| 76 |
-
# Evaluation
|
| 77 |
-
"CoherenceModel_ttc", "TopicQualityAssessor",
|
| 78 |
-
|
| 79 |
-
# Models
|
| 80 |
-
"DETM", "DTMTrainer", "CFDTM", "DynamicTrainer"
|
| 81 |
-
]
|
|
|
|
| 1 |
+
# This file is intentionally left empty.
|
| 2 |
+
# It marks the 'backend' directory as a Python package.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|