Skip to content

Commit fa3c06d

Browse files
committed
Updated README
1 parent 06de85e commit fa3c06d

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

README.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,38 @@
22
Graph builder package.
33

44
## Installation
5+
Following good practices we suggest you create a separate virtual environment for working with Graph builder package.
6+
7+
Note that the graph_builder requires python 3.12 or higher.
8+
59
```
610
poetry install
711
```
812

913
## Usage
14+
15+
Note that this is a short example taken from `examples/example1.ipynb`, for more information please
16+
refer to it.
1017
```python
11-
from entity_graph import EntitiesGraphExtractor
18+
from entity_graph.graph_extractor.entities_graph_extractor import EntitiesGraphExtractor
19+
20+
# Initialize the Extractor
21+
extractor = EntitiesGraphExtractor()
22+
23+
test_data_path = "" # replace it with a correct data path
1224

13-
builder = EntitiesGraphExtractor()
14-
builder.load_table_from_file(config)
25+
# Specify extraction configuration
26+
config = {
27+
"extraction_type": "table_from_header",
28+
"filename": test_data_path + "coffee_machines.pdf",
29+
"header": ['Manufacturer', 'Coffee Machine Name', 'Machine ID', 'Production Year', 'Machine Type', 'Power (W)', 'Pressure (bar)', 'Water Tank Capacity (L)', 'Additional Features'],
30+
}
1531

16-
builder.entities_graph_manager.export_objects_graph(collection="default")
32+
# Load table to graph
33+
extractor.load_table_from_file(
34+
config,
35+
"coffee_machines.pdf",
36+
"Machines",
37+
"instances",
38+
)
1739
```

0 commit comments

Comments
 (0)