Update README.md
Browse files
README.md
CHANGED
|
@@ -1,4 +1,7 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
| 2 |
dataset_info:
|
| 3 |
features:
|
| 4 |
- name: question_id
|
|
@@ -58,15 +61,17 @@ You can find our dataset on huggingface: 🤗[InfoChartQA Dataset](https://huggi
|
|
| 58 |
Each question entry is arranged as:
|
| 59 |
|
| 60 |
```
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
|
|
|
|
|
|
| 70 |
```
|
| 71 |
|
| 72 |
Each question is built as:
|
|
@@ -97,19 +102,25 @@ def build_question(query):#to build the question
|
|
| 97 |
with open("visual_basic.json","r",encode="utf-8") as f:
|
| 98 |
queries = json.load(f)
|
| 99 |
|
| 100 |
-
for
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
```
|
| 114 |
|
| 115 |
|
|
|
|
| 1 |
---
|
| 2 |
+
license: cc-by-4.0
|
| 3 |
+
---
|
| 4 |
+
---
|
| 5 |
dataset_info:
|
| 6 |
features:
|
| 7 |
- name: question_id
|
|
|
|
| 61 |
Each question entry is arranged as:
|
| 62 |
|
| 63 |
```
|
| 64 |
+
"question_id": id of the question,
|
| 65 |
+
"qtype": type of the question, for example: "rank" questions
|
| 66 |
+
"figure_path": local path of the image if you download the image,
|
| 67 |
+
"question": question,
|
| 68 |
+
"answer": answer,
|
| 69 |
+
"instructions": instructions,
|
| 70 |
+
"url": url of the image,
|
| 71 |
+
"bbox": bbox of the image, this is used for visual questions. Images with bbox should be cropped based on the bbox. bbox is formatted as [xmin, ymin, width, height] with no normalization.
|
| 72 |
+
"parent": the original image of the cropped image,
|
| 73 |
+
"difficulty": difficulty level,
|
| 74 |
+
"chart_type": chart_type,
|
| 75 |
```
|
| 76 |
|
| 77 |
Each question is built as:
|
|
|
|
| 102 |
with open("visual_basic.json","r",encode="utf-8") as f:
|
| 103 |
queries = json.load(f)
|
| 104 |
|
| 105 |
+
for query in tqdm(queries):
|
| 106 |
+
query_idx = query["question_id"]
|
| 107 |
+
question_text = build_question(query)
|
| 108 |
+
chart_figure = query["url"] # This should be a list of url
|
| 109 |
+
visual_figure = query.get("visual_figure_path",[])
|
| 110 |
+
|
| 111 |
+
# Replace with your model
|
| 112 |
+
response = model.generate(question_text, chart_figure + visual_figure)
|
| 113 |
+
|
| 114 |
+
|
| 115 |
+
Responses[query_idx] = {
|
| 116 |
+
"qtype": int(query["qtype"]),
|
| 117 |
+
"answer": query["answer"],
|
| 118 |
+
"question_id": query_idx,
|
| 119 |
+
"response": response,
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
with open("./model_response.json", "w", encoding="utf-8") as f:
|
| 123 |
+
json.dump(Responses, f, indent = 2, ensure_ascii=False)
|
| 124 |
```
|
| 125 |
|
| 126 |
|