Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions backend/app/models/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class AnalysisResult(Base):
file_size = Column(Integer, nullable=False) # bytes
file_hash = Column(String(64), unique=True, index=True) # SHA256
word_count = Column(Integer, nullable=False, default=0)
author_name = Column(String(255), nullable=True)
institution = Column(String(255), nullable=True)

# Module scores
plagiarism_score = Column(Integer, nullable=False) # 0-100
Expand Down Expand Up @@ -74,6 +76,8 @@ def to_dict(self):
"writing_quality_score": self.writing_quality_score,
"overall_research_credibility": self.overall_research_credibility,
"verdict": self.verdict,
"author_name": self.author_name,
"institution": self.institution,
"report_path": self.report_path,
"analyzed_at": self.analyzed_at.isoformat() if self.analyzed_at else None,
"provenance_score": self.provenance_score,
Expand Down
3 changes: 3 additions & 0 deletions backend/app/models/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class PlagiarismMatchSchema(BaseModel):
similarity: float = Field(..., ge=0, le=100)
source: str
matched_text: str
match_type: str = "uncited" # uncited, cited, internal, web


class PlagiarismModuleResult(BaseModel):
Expand Down Expand Up @@ -95,6 +96,8 @@ class ScoreContributions(BaseModel):

class AnalysisResult(BaseModel):
filename: str
author_name: Optional[str] = None
institution: Optional[str] = None
analyzed_at: str
word_count: int
section_count: int
Expand Down
1 change: 1 addition & 0 deletions backend/app/services/plagiarism.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class SimilarityMatch:
source_corpus: str
similarity: float
matched_text: str
match_type: str = "uncited" # uncited, cited, internal, web


@dataclass
Expand Down
Loading