NchuNLP commited on
Commit
72cff08
1 Parent(s): 88c63f9

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +0 -23
README.md CHANGED
@@ -25,29 +25,6 @@ QA_input = {
25
  }
26
  res = nlp(QA_input)
27
 
28
- # b) Load model & tokenizer
29
- model = BertForQuestionAnswering.from_pretrained(model_name)
30
- tokenizer = BertTokenizerFast.from_pretrained(model_name)
31
-
32
- # c) Load API
33
-
34
- import requests
35
-
36
- API_URL = "https://api-inference.huggingface.co/models/NchuNLP/Chinese-Question-Answering"
37
- headers = {"Authorization": "Bearer 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"}
38
-
39
- def query(payload):
40
- response = requests.post(API_URL, headers=headers, json=payload)
41
- return response.json()
42
-
43
- output = query({
44
- "inputs": {
45
- "question": "中興大學在哪里?",
46
- "context": "國立中興大學(簡稱興大、NCHU),是位於臺中的一所高等教育機構。中興大學以農業科學、農業經濟學、獸醫、生命科學、轉譯醫學、生醫工程、生物科技、綠色科技等研究領域見長 。近年中興大學與臺中榮民總醫院、彰化師範大學、中國醫藥大學等機構合作,聚焦於癌症醫學、免疫醫學及醫學工程三項領域,將實驗室成果逐步應用到臨床上,未來「衛生福利部南投醫院中興院區」將改為「國立中興大學醫學院附設醫院」。興大也與臺中市政府合作,簽訂合作意向書,共同推動數位文化、智慧城市等面相帶動區域發展。"
47
- },
48
- })
49
-
50
- print(output)
51
  ```
52
 
53
  ## Authors
 
25
  }
26
  res = nlp(QA_input)
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  ```
29
 
30
  ## Authors