Thesis Review Agent
HWPX 논문에서 본문 인용과 참고문헌을 추출하고, AI 분류와 규칙 검증으로 표기 오류 후보를 반환하는 Python 패키지입니다. 문서를 수정하지는 않습니다.
검토 보조 도구이므로 결과를 원문 및 적용할 학술 작성 지침과 대조해 확인하세요. AI 분류나 자동 검증은 완전한 학술적 판단을 보장하지 않습니다.
설치 및 준비
- Python 3.12 이상
- OpenAI API 키
- 검토할 HWPX 파일
python -m pip install thesis-review-agent
export OPENAI_API_KEY="your-api-key"
Windows PowerShell에서는 API 키를 다음처럼 설정할 수 있습니다.
$env:OPENAI_API_KEY = "your-api-key"
기본 모델은 gpt-5.6-luna입니다. AI 호출 시 문장과 참고문헌 등 문서 내용이 API로 전달되고 사용료가 발생할 수 있습니다. 민감한 문서를 처리하기 전 조직의 보안 정책과 API 사용 조건을 확인하세요.
바로 사용하기
아래 코드는 파일을 검토하고 CIT·REF·TYP 위반 후보를 JSON으로 출력합니다.
import asyncio
import json
from pathlib import Path
from thesis_review_agent import ThesisReviewAgent
async def main() -> None:
hwpx_bytes = Path("thesis.hwpx").read_bytes()
agent = ThesisReviewAgent()
result = await agent.run(hwpx_bytes)
print(json.dumps(result.model_dump(mode="json"), ensure_ascii=False, indent=2))
asyncio.run(main())
run()은 내부 그래프 State 대신 공개 응답 모델인 ThesisReviewResult를 반환합니다. quotation_issues에는 본문 인용 규칙(CIT) 위반 후보가, reference_issues에는 참고문헌 일반 규칙(REF)과 자료유형별 규칙(TYP) 위반 후보가 있습니다. 목록이 비어 있으면 해당 실행에서 위반 후보를 찾지 못했다는 뜻이지, 문서가 모든 기준을 충족한다고 보증하는 것은 아닙니다.
다른 모델 지정하기
실행별 model 인수로 사용할 모델을 지정할 수 있습니다.
result = await agent.run(hwpx_bytes, model="gpt-5.6-luna")
설정을 생략하면 패키지 기본 모델을 사용합니다.
결과 읽기
ThesisReviewResult는 그래프 State 자체를 반환하지 않고, 사용자가 결과를 확인하거나 후처리할 때 필요한 입력 원본과 분석 결과만 공개합니다. 공개 모델은 thesis_review_agent.results 패키지에 클래스별 파일로 분리되어 있고 모두 Pydantic BaseModel입니다.
source_hwpx_bytes: 입력한 원본 파일 바이트. JSON 직렬화에서는 안전하게 Base64 문자열로 변환됩니다.document: HWPX 변환 구조(HwpxModel). 원문 텍스트와 문단·run·서식 구조를 확인할 수 있습니다.quotations: 추출된 인용과 저자·연도 정보, 인용 검증 분류 결과.references: 참고문헌 원문과 상위 자료유형, REF 분류 및 유형별 세부 분류, 추출된 글자 서식.quotation_issues,reference_issues: 각각 CIT와 REF·TYP 검증에서 발견한 위반 후보.
JSON 직렬화에는 result.model_dump(mode="json")을 사용합니다. 원본 HWPX 바이트가 JSON 안에 포함되므로 결과 JSON 크기가 커질 수 있습니다. 바이트가 필요 없으면 직렬화 시 exclude={"source_hwpx_bytes"}로 제외할 수 있습니다.
| 필드 | 의미 |
|---|---|
rule_id |
위반 후보의 규칙 ID (CIT-001, REF-021, TYP-009 등) |
message |
위반으로 판단한 이유와 수정 안내 |
quotation |
위반된 본문 인용 문자열. 참고문헌 이슈에서는 null |
text |
인용이 포함된 원문 문장 또는 참고문헌 항목 |
location |
원문 위치. 구역·문단·run·content·문장 번호를 사용자용 1부터 시작하는 번호로 제공 |
result.has_issues는 두 이슈 목록 중 하나라도 비어 있지 않은지 나타냅니다. 규칙 ID는 인용 검증의 CIT, 일반 참고문헌 검증의 REF, 자료유형별 참고문헌 검증의 TYP로 구분됩니다.
검증 흐름
HWPX 변환 → 문장 분류
├─ 본문 인용 추출·분류
└─ 참고문헌 추출
├─ 자료유형 분류 → 유형별 TYP 검증
└─ 일반 REF 규칙용 특성 분류 → REF 검증
참고문헌 검증 완료 → CIT 검증
분류가 필요한 적용 조건이나 자료 특성은 내부 AI 노드에서 판별하고, 해당 분류 결과를 바탕으로 검증 노드가 규칙을 적용합니다. 공개 API는 내부 State와 그래프 객체를 반환하지 않습니다. 노드별 내부 동작을 이해하려는 개발자는 thesis_review_agent/graph/README.md를 참고하세요.
제한 사항
- 지원 입력은 HWPX 바이트이며, DOCX/PDF 입력이나 원본 문서 자동 수정은 제공하지 않습니다.
- 추출·분류가 잘못되거나 문서 서식 정보가 충분하지 않으면 위반을 놓치거나 오탐할 수 있습니다.
- 그래프 실행 중 발생한 예외는 호출자에게 전달됩니다.
Metadata
Release files for thesis-review-agent 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| thesis_review_agent-0.0.8.tar.gz | 130.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| thesis_review_agent-0.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 438.9 kB
Release files / thesis_review_agent-0.0.8.tar.gz
| Download URL | thesis_review_agent-0.0.8.tar.gz |
|---|---|
| Size | 130.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2659c52ce606a19427007a1f5ea6778f98cb9734acfa9a4318d38642dce7b655
|
|
BLAKE2b-256 checksum How to use checksums |
dd312e695b674e4f94495d1288055bb8d21a8e0de6d413bc433780cd3930f75f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.
Transparency logRelease files / thesis_review_agent-0.0.8-py3-none-any.whl
| Download URL | thesis_review_agent-0.0.8-py3-none-any.whl |
|---|---|
| Size | 308.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3ff7fc60d9e4bb10d514c222a2926da417d3a43c26bf81807cd2e8cae11e900c
|
|
BLAKE2b-256 checksum How to use checksums |
d02515d1f9d4e87d60edee669dea635332098ca8e808a20cb7c907defc61c99c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.
Transparency log