Skip to content

Commit 19a9078

Browse files
Merge pull request #38 from kensho-technologies/libin/add_support_to_images
[kensho-kenverters] Add support of image type.
2 parents 5c0418a + 4333131 commit 19a9078

File tree

6 files changed

+55
-2
lines changed

6 files changed

+55
-2
lines changed

kensho_kenverters/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## v2.1.0
4+
5+
### Added
6+
7+
* Add support of image type.
8+
39
## v2.0.0
410

511
* Add parsing of table structure.

kensho_kenverters/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class ContentCategory(Enum):
6161
LINE_PLOT = "LINE_PLOT"
6262
PIE_CHART = "PIE_CHART"
6363
SCATTER_PLOT = "SCATTER_PLOT"
64+
IMAGE = "IMAGE"
6465

6566

6667
ELEMENT_TITLE_CONTENT_CATEGORIES = {

kensho_kenverters/tests/data/extract_output.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

kensho_kenverters/tests/test_convert_output.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ def test_convert_output_to_items(self) -> None:
123123
"to as predictive analytics.",
124124
},
125125
{"category": "figure", "text": ""},
126+
{"category": "image", "text": ""},
126127
{"category": "title", "text": "Recommendation: BUY"},
127128
{"category": "text", "text": "42"},
128129
{"category": "text", "text": "test noise string at bottom"},
@@ -272,6 +273,19 @@ def test_convert_output_to_items(self) -> None:
272273
)
273274
],
274275
},
276+
{
277+
"category": "image",
278+
"text": "",
279+
"locations": [
280+
LocationModel(
281+
height=0.02,
282+
width=0.15,
283+
x=0.5,
284+
y=0.87,
285+
page_number=0,
286+
)
287+
],
288+
},
275289
{
276290
"category": "title",
277291
"text": "Recommendation: BUY",

kensho_kenverters/tests/test_output_to_sections.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def test_extract_organized_sections(self) -> None:
100100
),
101101
},
102102
{"category": "figure", "text": ""},
103+
{"category": "image", "text": ""},
103104
],
104105
[
105106
{"category": "title", "text": "Recommendation: BUY"},
@@ -975,6 +976,21 @@ def test_extract_organized_sections(self) -> None:
975976
"type": "FIGURE",
976977
"uid": "33",
977978
},
979+
{
980+
"children": [],
981+
"content": "",
982+
"locations": [
983+
{
984+
"height": 0.02,
985+
"page_number": 0,
986+
"width": 0.15,
987+
"x": 0.5,
988+
"y": 0.87,
989+
}
990+
],
991+
"type": "IMAGE",
992+
"uid": "38",
993+
},
978994
{
979995
"children": [],
980996
"content": "Recommendation: BUY",
@@ -1909,6 +1925,21 @@ def test_extract_organized_sections(self) -> None:
19091925
"type": "FIGURE",
19101926
"uid": "33",
19111927
},
1928+
{
1929+
"children": [],
1930+
"content": "",
1931+
"locations": [
1932+
{
1933+
"height": 0.02,
1934+
"page_number": 0,
1935+
"width": 0.15,
1936+
"x": 0.5,
1937+
"y": 0.87,
1938+
}
1939+
],
1940+
"type": "IMAGE",
1941+
"uid": "38",
1942+
},
19121943
{
19131944
"children": [],
19141945
"content": "Recommendation: BUY",
@@ -2007,6 +2038,7 @@ def test_extract_organized_sections(self) -> None:
20072038
),
20082039
},
20092040
{"category": "figure", "text": ""},
2041+
{"category": "image", "text": ""},
20102042
],
20112043
[{"category": "title", "text": "Recommendation: BUY"}],
20122044
]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "kensho_kenverters"
3-
version = "2.0.0"
3+
version = "2.1.0"
44
description = "Extract Output Translator Tools"
55
readme = "README.md"
66
authors = ["Valerie Faucon-Morin <valerie.fauconmorin@kensho.com>"]

0 commit comments

Comments
 (0)