Automatic generate QA from slides and grade marker/memo.
Project description
AutoTA
提供BookRoll中的Marker/Memo評分功能,以及教材推薦功能
準備
以下四個服務需要先以docker在本地端或遠端建立
- Question generation service(問題生成才要)
- BERT pre-trained model service
- BERT fine-tuned model service(簡答題評分才要)
- Google cloud translation service(問題生成才要)
安裝
pip install autota
使用
獲取Marker/Memo分數
from autota.grader import Grader
grader = Grader(pdf_path='./test.pdf',
bert_api_port=PRETRAINED_BERT_SERVICE_PORT,
bert_api_url='PRETRAINED_BERT_SERVICE_HOST')
print(grader.grade_marker('marker text')) #得到單一marker分數
print(grader.grade_memo('memo text')) #得到單一memo分數
獲取教材推薦頁數
from autota.recommender import Recommender
#num_page指定要推薦多少頁
recommender = Recommender(pdf_path='./test.pdf', num_page=2,
api_port=PRETRAINED_BERT_SERVICE_PORT,
api_url='PRETRAINED_BERT_SERVICE_HOST')
print(recommender.guiding_from(ta_ans='要推薦的概念'))
#輸出為[(2, 0.0778473040773201), (1, 0.08752984923065377)]
#tuple第一項元素即為頁數,第二項為該頁與ta_ans概念間的餘弦距離
從教材自動生成問題
from autota.generator import Generator
#num_page指定要推薦多少頁
generator = Generator(pdf_path='./test.pdf',,
translate_api_port=TRANSLATE_SERVICE_PORT,
translate_api_url='TRANSLATE_SERVICE_HOST',
gpt2_api_port=GPT2_SERVICE_PORT,
gpt2_api_url='GPT2_SERVICE_HOST')
print(generator.get_qa())
#輸出為[('What is the first thing that can be a variable name?', '變數名稱的第一個字不可為數字')]
#list中每個tuple為一組QA pair
開發中
- 簡答題自動評分
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
autota-0.0.3.tar.gz
(7.9 kB
view details)
Built Distribution
File details
Details for the file autota-0.0.3.tar.gz
.
File metadata
- Download URL: autota-0.0.3.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1431df8ffda349d7a6513b883f5275f66027866f467b695a790ee4b4334abe90 |
|
MD5 | 4621250ac9bfa19dee9e187048e2ec9d |
|
BLAKE2b-256 | 3f15f9c407328677812023d7e44c6dc81214cece5a65efe10d1bc27cbbc99d6e |
File details
Details for the file autota-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: autota-0.0.3-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0b5d8d7fe4dede6dbb9c92b8957c09a10014bead188bab5922f509a6713d959 |
|
MD5 | fa6e4edbac9f51cdf63239ab2ef44137 |
|
BLAKE2b-256 | a40771820c0796ebe9771a57f3b03bb1739b9cd4b674d7404cf9ac7c97f0e0bb |