academic-refchecker 2.0.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- academic_refchecker-2.0.7.dist-info/METADATA +738 -0
- academic_refchecker-2.0.7.dist-info/RECORD +64 -0
- academic_refchecker-2.0.7.dist-info/WHEEL +5 -0
- academic_refchecker-2.0.7.dist-info/entry_points.txt +3 -0
- academic_refchecker-2.0.7.dist-info/licenses/LICENSE +21 -0
- academic_refchecker-2.0.7.dist-info/top_level.txt +2 -0
- backend/__init__.py +21 -0
- backend/__main__.py +11 -0
- backend/cli.py +64 -0
- backend/concurrency.py +100 -0
- backend/database.py +711 -0
- backend/main.py +1367 -0
- backend/models.py +99 -0
- backend/refchecker_wrapper.py +1126 -0
- backend/static/assets/index-2P6L_39v.css +1 -0
- backend/static/assets/index-hk21nqxR.js +25 -0
- backend/static/favicon.svg +6 -0
- backend/static/index.html +15 -0
- backend/static/vite.svg +1 -0
- backend/thumbnail.py +517 -0
- backend/websocket_manager.py +104 -0
- refchecker/__init__.py +13 -0
- refchecker/__main__.py +11 -0
- refchecker/__version__.py +3 -0
- refchecker/checkers/__init__.py +17 -0
- refchecker/checkers/crossref.py +541 -0
- refchecker/checkers/enhanced_hybrid_checker.py +563 -0
- refchecker/checkers/github_checker.py +326 -0
- refchecker/checkers/local_semantic_scholar.py +540 -0
- refchecker/checkers/openalex.py +513 -0
- refchecker/checkers/openreview_checker.py +984 -0
- refchecker/checkers/pdf_paper_checker.py +493 -0
- refchecker/checkers/semantic_scholar.py +764 -0
- refchecker/checkers/webpage_checker.py +938 -0
- refchecker/config/__init__.py +1 -0
- refchecker/config/logging.conf +36 -0
- refchecker/config/settings.py +170 -0
- refchecker/core/__init__.py +7 -0
- refchecker/core/db_connection_pool.py +141 -0
- refchecker/core/parallel_processor.py +415 -0
- refchecker/core/refchecker.py +5838 -0
- refchecker/database/__init__.py +6 -0
- refchecker/database/download_semantic_scholar_db.py +1725 -0
- refchecker/llm/__init__.py +0 -0
- refchecker/llm/base.py +376 -0
- refchecker/llm/providers.py +911 -0
- refchecker/scripts/__init__.py +1 -0
- refchecker/scripts/start_vllm_server.py +121 -0
- refchecker/services/__init__.py +8 -0
- refchecker/services/pdf_processor.py +268 -0
- refchecker/utils/__init__.py +27 -0
- refchecker/utils/arxiv_utils.py +462 -0
- refchecker/utils/author_utils.py +179 -0
- refchecker/utils/biblatex_parser.py +584 -0
- refchecker/utils/bibliography_utils.py +332 -0
- refchecker/utils/bibtex_parser.py +411 -0
- refchecker/utils/config_validator.py +262 -0
- refchecker/utils/db_utils.py +210 -0
- refchecker/utils/doi_utils.py +190 -0
- refchecker/utils/error_utils.py +482 -0
- refchecker/utils/mock_objects.py +211 -0
- refchecker/utils/text_utils.py +5057 -0
- refchecker/utils/unicode_utils.py +335 -0
- refchecker/utils/url_utils.py +307 -0
backend/models.py
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Pydantic models for API request/response validation
|
|
3
|
+
"""
|
|
4
|
+
from pydantic import BaseModel, Field
|
|
5
|
+
from typing import Optional, List, Dict, Any
|
|
6
|
+
from datetime import datetime
|
|
7
|
+
from enum import Enum
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class CheckSource(str, Enum):
|
|
11
|
+
"""Source type for paper check"""
|
|
12
|
+
URL = "url"
|
|
13
|
+
FILE = "file"
|
|
14
|
+
TEXT = "text"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class CheckRequest(BaseModel):
|
|
18
|
+
"""Request to check a paper"""
|
|
19
|
+
source_type: CheckSource
|
|
20
|
+
source_value: str # URL or filename
|
|
21
|
+
llm_provider: Optional[str] = "anthropic"
|
|
22
|
+
llm_model: Optional[str] = None
|
|
23
|
+
use_llm: bool = True
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class ReferenceError(BaseModel):
|
|
27
|
+
"""Error or warning in a reference"""
|
|
28
|
+
error_type: str # 'author', 'title', 'year', 'doi', 'venue', 'arxiv_id', 'unverified'
|
|
29
|
+
error_details: str
|
|
30
|
+
cited_value: Optional[str] = None
|
|
31
|
+
actual_value: Optional[str] = None
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class ReferenceURL(BaseModel):
|
|
35
|
+
"""Authoritative URL for a reference"""
|
|
36
|
+
type: str # 'semantic_scholar', 'arxiv', 'doi', 'other'
|
|
37
|
+
url: str
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class ReferenceResult(BaseModel):
|
|
41
|
+
"""Result for a single reference check"""
|
|
42
|
+
index: int
|
|
43
|
+
title: str
|
|
44
|
+
authors: List[str]
|
|
45
|
+
year: Optional[str] = None
|
|
46
|
+
venue: Optional[str] = None
|
|
47
|
+
cited_url: Optional[str] = None
|
|
48
|
+
status: str # 'verified', 'error', 'warning', 'unverified'
|
|
49
|
+
errors: List[ReferenceError] = []
|
|
50
|
+
warnings: List[ReferenceError] = []
|
|
51
|
+
authoritative_urls: List[ReferenceURL] = []
|
|
52
|
+
corrected_reference: Optional[str] = None
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class SummaryStats(BaseModel):
|
|
56
|
+
"""Summary statistics for check"""
|
|
57
|
+
total_refs: int
|
|
58
|
+
processed_refs: int
|
|
59
|
+
errors_count: int
|
|
60
|
+
warnings_count: int
|
|
61
|
+
unverified_count: int
|
|
62
|
+
verified_count: int
|
|
63
|
+
progress_percent: float
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class CheckStatus(str, Enum):
|
|
67
|
+
"""Status of check operation"""
|
|
68
|
+
STARTED = "started"
|
|
69
|
+
EXTRACTING = "extracting"
|
|
70
|
+
CHECKING = "checking"
|
|
71
|
+
COMPLETED = "completed"
|
|
72
|
+
ERROR = "error"
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class WebSocketMessage(BaseModel):
|
|
76
|
+
"""WebSocket message format"""
|
|
77
|
+
type: str # 'started', 'progress', 'reference_result', 'summary_update', 'completed', 'error'
|
|
78
|
+
data: Dict[str, Any]
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class CheckHistoryItem(BaseModel):
|
|
82
|
+
"""History item summary"""
|
|
83
|
+
id: int
|
|
84
|
+
paper_title: str
|
|
85
|
+
paper_source: str
|
|
86
|
+
timestamp: str
|
|
87
|
+
total_refs: int
|
|
88
|
+
errors_count: int
|
|
89
|
+
warnings_count: int
|
|
90
|
+
unverified_count: int
|
|
91
|
+
llm_provider: Optional[str] = None
|
|
92
|
+
llm_model: Optional[str] = None
|
|
93
|
+
status: str = "completed"
|
|
94
|
+
source_type: Optional[str] = None
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class CheckHistoryDetail(CheckHistoryItem):
|
|
98
|
+
"""Detailed history item with full results"""
|
|
99
|
+
results: List[ReferenceResult]
|