Skip to content

Jaxx1911/ModelTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Summarization Server

Cài đặt

python -m venv .venv
.venv\\Scripts\\activate
pip install -r requirements.txt

Chạy server

uvicorn main:app --reload

API

  • POST /summarize

    • body:
      { "model_id": 1, "content": "text", "max_sentences": 3 }
    • model_id: 1=tfidf, 2=textrank, 3=vit5, 4=bartpho
    • Với 3/4 có thể truyền max_tokens (mặc định 128)
  • POST /summarize_all

    • body:
      { "content": "text", "max_sentences": 3, "max_tokens": 128 }
    • trả về 4 khóa: tfidf, textrank, vit5, bartpho
    • ghi chú: 2 mô hình transformers cần tải nặng, lần đầu có thể chậm

Cấu hình BARTpho

  • Đặt biến môi trường BARTPHO_MODEL_ID để chỉ định repo/model id trên Hugging Face cho BARTpho.
  • Nếu không đặt, hệ thống mặc định dùng VietAI/bartpho-syllable-base.

Xem test_main.http để có ví dụ gọi thử.

UI

  • Truy cập http://127.0.0.1:8000/ui để mở giao diện:
    • Nhập nội dung và bấm "Tóm tắt 4 mô hình" để nhận đồng thời 4 kết quả.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages