Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hf implementation #3

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
scripts/*.sh
**/__pycache__
*events.out*
output/**/*.json
*.png
.ipynb_checkpoints
107 changes: 66 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,95 @@
# RxnScribe
# MolDetect and MolCoref

This is the repository for RxnScribe, a sequence generation model for reaction diagram parsing.
Try our [demo](https://huggingface.co/spaces/yujieq/RxnScribe) on Hugging Face!

![](assets/model.png)
This is the repository for MolDetect and MolCoref, two sequence generation models for reaction diagram parsing.

## Quick Start
Run the following command to install the package and its dependencies:
```
git clone git@github.com:thomas0809/RxnScribe.git
git clone git@github.com:Ozymandias314/MolDetect.git
cd RxnScribe
python setup.py install
```

Download the checkpoint and use RxnScribe to extract reactions from a diagram:
```python
Download the checkpoint and use MolDetect to extract molecules from reaction diagrams:

```python
import torch
from rxnscribe import RxnScribe
from rxnscribe import MolDetect
from huggingface_hub import hf_hub_download

ckpt_path = hf_hub_download("yujieq/RxnScribe", "pix2seq_reaction_full.ckpt")
model = RxnScribe(ckpt_path, device=torch.device('cpu'))
ckpt_path = hf_hub_download("Ozymandias314/MolDetectCkpt", "best.ckpt")
model = MolDetect(ckpt_path, device=torch.device('cpu'))

image_file = "assets/jacs.5b12989-Table-c3.png"
predictions = model.predict_image_file(image_file, molscribe=True, ocr=True)
predictions = model.predict_image_file(image_file)
```
The predictions will be in the following format:
```python
[
{ # First reaction
'reactants': [
{
'category': '[Mol]', 'category_id': 1, 'bbox': (0.1550, 0.0246, 0.2851, 0.2614),
'smiles': '*OC(=O)c1ccccc1C#Cc1ccccc1', 'molfile': '(omitted)'
},
# ... more reactants
],
'conditions': [
{
'category': '[Txt]', 'category_id': 2, 'bbox': (0.2941, 0.0641, 0.3811, 0.1450),
'text': ['CIBcat', '(1.4 equiv)']
},
# ... more conditions
],
'products': [
# ...
]
{ #first bbox
'category': '[Sup]',
'bbox': (0.0050025012506253125, 0.38273870663142223, 0.9934967483741871, 0.9450094869920168),
'category_id': 4,
'score': -0.07593922317028046
},
# More reactions
#More bounding boxes
]
```
We provide a function to visualize the prediction:
We provide a function to visualize the predicted bboxes:
```python
visualize_images = model.draw_predictions(predictions, image_file=image_file)
visualize_images = model.draw_bboxes(predictions, image_file = image_file)
```
Each predicted reaction will be visualized in a separate image, where
<b style="color:red">red boxes are <i><u style="color:red">reactants</u></i>,</b>
<b style="color:green">green boxes are <i><u style="color:green">reaction conditions</u></i>,</b>
<b style="color:blue">blue boxes are <i><u style="color:blue">products</u></i>.</b>

<img src="assets/output/output0.png" width="384"/> <img src="assets/output/output1.png" width="384"/>
Each predicted diagram will be visualized in a seperate image, where
<b style="color:red">red boxes are <i><u style="color:red">molecules</u></i>,</b>
<b style="color:green">green boxes are <i><u style="color:green">text</u></i>,</b>
<b style="color:blue">blue boxes are <i><u style="color:blue">identifiers</u></i>.</b>
<b style="color:gold">gold boxes are <i><u style="color:blue">supplementary information</u></i>.</b>

This [notebook](notebook/predict.ipynb) shows how to run RxnScribe and visualize the prediction.
<img src="assets/output/output2.png" width = "384"/>

For development or reproducing the experiments, follow the instructions below.
To detect bounding boxes and also the coreference, download the coreference checkpoint for MolDetect on huggingface and also set the coref field to be true:

```python
import torch
from rxnscribe import MolDetect
from huggingface_hub import hf_hub_download

ckpt_path = hf_hub_download("Ozymandias314/MolDetectCkpt", "coref_best.ckpt")
model = MolDetect(ckpt_path, device=torch.device('cpu'), coref = True)

image_file = "assets/jacs.5b12989-Table-c3.png"
predictions = model.predict_image_file(image_file, coref = True)
```

The predictions will be in the following format:

```python
{
'bboxes': [
{ #first bbox
'category': '[Sup]',
'bbox': (0.0050025012506253125, 0.38273870663142223, 0.9934967483741871, 0.9450094869920168),
'category_id': 4,
'score': -0.07593922317028046
},
#More bounding boxes
],
'coref': [
[0, 1],
[3, 4],
#More coref pairs
]
}
```

Similarly, we provide a function to visualize the predicted bboxes:

```python
visualize_images = model.draw_bboxes(predictions, image_file = image_file, coref = True)
```

For development or reproducing the experiments, follow the instructions below.
## Requirements
Install the required packages
```
Expand All @@ -73,7 +98,7 @@ pip install -r requirements.txt

## Data
Download the reaction diagrams from this [link](https://huggingface.co/yujieq/RxnScribe/blob/main/images.zip),
and save them to `data/parse/images/`.
and save them to `data/detect/images/`.

The ground truth files can be found at [`data/parse/splits/`](data/parse/splits/).

Expand Down
Binary file added assets/output/output2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/coref/annotations_dec.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/coref/annotations_dec_with_annotation.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/coref/splits/annotations/coref_redo_test.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/coref/splits/annotations/coref_redo_train.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/coref/splits/annotations/coref_redo_val.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/coref/splits/annotations/coref_test.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/coref/splits/annotations/coref_train.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/coref/splits/annotations/coref_val.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/coref/splits/annotations/full_coref_val_filtered.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions data/detect/.ipynb_checkpoints/sample no mol-checkpoint.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}
11,339 changes: 11,339 additions & 0 deletions data/detect/sample no mol.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}
104 changes: 104 additions & 0 deletions data/detect/splits/annotations/Untitled.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 5,
"id": "90feaae3-97b6-4516-aba0-89f91fdc8564",
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"categories\n",
"licenses\n",
"images\n",
"annotations\n",
"categories\n",
"licenses\n",
"images\n",
"annotations\n"
]
}
],
"source": [
"import json\n",
"\n",
"# List the names of the JSON files to be read\n",
"files = ['detect_test.json', 'detect_train.json', 'detect_val.json']\n",
"\n",
"# Create an empty dictionary to hold the combined data\n",
"combined_data = {}\n",
"\n",
"# Loop over each file\n",
"for filename in files:\n",
" # Open the file and load its contents into a dictionary\n",
" with open(filename, 'r') as f:\n",
" data = json.load(f)\n",
" \n",
" # Combine the data into the combined_data dictionary\n",
" for key, value in data.items():\n",
" if key in combined_data and key != \"info\":\n",
" print(key)\n",
" combined_data[key].extend(value)\n",
" else:\n",
" combined_data[key] = value\n",
"\n",
"# Write the combined data to a new JSON file\n",
"with open('detect_combined.json', 'w') as f:\n",
" json.dump(combined_data, f)\n"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "ef9b649b-00e3-4e4e-815d-345fa0eac053",
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[{'id': 1, 'width': 3396, 'height': 1776, 'file_name': 'jacs.6b00143-Table-c2.png', 'license': 0, 'flickr_url': '', 'coco_url': '', 'date_captured': 0, 'bboxes': [{'bbox': [2390.35, 60.38, 146.74, 112.34], 'category_id': 1, 'id': 5}, {'bbox': [1262.95, 198.63, 49.38, 36.4], 'category_id': 3, 'id': 6}, {'bbox': [878.06, 201.87, 81.18, 34.45], 'category_id': 3, 'id': 7}, {'bbox': [2443.58, 201.87, 28.61, 35.1], 'category_id': 3, 'id': 8}, {'bbox': [289.0, 259.21, 2816.1, 1237.18], 'category_id': 4, 'id': 9}, {'bbox': [1486.22, 2.61, 310.95, 118.83], 'category_id': 2, 'id': 10}, {'bbox': [1908.11, 9.1, 357.68, 188.28], 'category_id': 1, 'id': 11}, {'bbox': [1127.7, 41.51, 272.44, 171.58], 'category_id': 1, 'id': 12}, {'bbox': [848.15, 59.84, 146.35, 109.71], 'category_id': 1, 'id': 13}, {'bbox': [1483.62, 148.0, 319.39, 42.89], 'category_id': 2, 'id': 14}, {'bbox': [2043.11, 201.87, 27.96, 35.1], 'category_id': 3, 'id': 15}], 'caption': 'Table 2. Substrate Scope for Kinetic Resolutions of Sulfoximines and a Sulfondiimide with Enal 2ba', 'pdf': {'Page': 2, 'DPI': 100, 'Width': 869, 'Height': 1137, 'CaptionBB': [82, 656, 648, 677], 'ImageBB': [10, 683, 859, 1127]}}, {'id': 2, 'width': 1356, 'height': 688, 'file_name': 'jacs.5b12989-Table-c3.png', 'license': 0, 'flickr_url': '', 'coco_url': '', 'date_captured': 0, 'bboxes': [{'bbox': [6.65, 262.6, 1338.95, 417.44], 'category_id': 4, 'id': 16}, {'bbox': [965.41, 10.46, 176.88, 169.79], 'category_id': 1, 'id': 17}, {'bbox': [624.51, 10.46, 176.0, 169.79], 'category_id': 1, 'id': 18}, {'bbox': [209.94, 14.9, 176.88, 165.3], 'category_id': 1, 'id': 19}, {'bbox': [399.03, 42.42, 119.18, 58.82], 'category_id': 2, 'id': 20}, {'bbox': [399.03, 122.3, 172.44, 62.38], 'category_id': 2, 'id': 21}, {'bbox': [815.38, 103.68, 134.27, 33.07], 'category_id': 2, 'id': 22}, {'bbox': [288.95, 206.65, 23.3, 29.52], 'category_id': 3, 'id': 23}, {'bbox': [707.96, 206.65, 25.97, 29.52], 'category_id': 3, 'id': 24}, {'bbox': [1051.52, 206.65, 49.94, 29.52], 'category_id': 3, 'id': 25}, {'bbox': [815.38, 35.32, 100.54, 59.7], 'category_id': 2, 'id': 26}], 'caption': 'Table 3. Mechanistic Insight from O-Alkyl Group Variance of the Oxyboration Reaction ', 'pdf': {'Page': 3, 'DPI': 100, 'Width': 869, 'Height': 1137, 'CaptionBB': [449, 91, 784, 125], 'ImageBB': [448, 131, 787, 303]}}, {'id': 12, 'width': 1344, 'height': 800, 'file_name': 'ja9810742-Table-c3.png', 'license': 0, 'flickr_url': '', 'coco_url': '', 'date_captured': 0, 'bboxes': [{'bbox': [612.17, 106.36, 169.22, 43.29], 'category_id': 2, 'id': 176}, {'bbox': [619.39, 27.91, 155.81, 45.35], 'category_id': 2, 'id': 177}, {'bbox': [806.23, 2.1, 277.62, 183.68], 'category_id': 1, 'id': 178}, {'bbox': [364.43, 10.36, 235.29, 171.29], 'category_id': 1, 'id': 179}, {'bbox': [935.26, 184.81, 37.1, 37.1], 'category_id': 3, 'id': 180}, {'bbox': [467.65, 185.84, 37.1, 40.2], 'category_id': 3, 'id': 181}, {'bbox': [244.68, 75.39, 52.58, 41.23], 'category_id': 3, 'id': 182}, {'bbox': [2.1, 310.75, 1337.75, 483.03], 'category_id': 4, 'id': 183}, {'bbox': [811.39, 232.3, 281.74, 44.32], 'category_id': 2, 'id': 184}], 'caption': 'Table 3. Allylation of 3-Phenylpropanal 1a with Homoallylic Alcohols 2a ', 'pdf': {'Page': 2, 'DPI': 100, 'Width': 850, 'Height': 1100, 'CaptionBB': [74, 544, 385, 569], 'ImageBB': [74, 570, 410, 770]}}, {'id': 17, 'width': 1168, 'height': 824, 'file_name': 'ja960062i-Figure-c4.png', 'license': 0, 'flickr_url': '', 'coco_url': '', 'date_captured': 0, 'bboxes': [{'bbox': [51.41, 500.95, 333.73, 110.45], 'category_id': 1, 'id': 208}, {'bbox': [421.42, 220.25, 159.35, 34.96], 'category_id': 2, 'id': 209}, {'bbox': [451.19, 429.71, 655.88, 385.82], 'category_id': 1, 'id': 210}, {'bbox': [653.2, 5.48, 507.03, 351.8], 'category_id': 1, 'id': 211}, {'bbox': [5.7, 15.05, 334.78, 341.17], 'category_id': 1, 'id': 212}, {'bbox': [364.0, 119.25, 266.75, 36.02], 'category_id': 2, 'id': 213}], 'caption': 'Figure 4. Scheme of synthesis of oligonucleotide-CHEVP conjugate by the diamine method. ', 'pdf': {'Page': 4, 'DPI': 100, 'Width': 850, 'Height': 1100, 'CaptionBB': [73, 260, 408, 286], 'ImageBB': [95, 50, 387, 256]}}, {'id': 23, 'width': 1352, 'height': 1080, 'file_name': 'ja905415r-Table-c5.png', 'license': 0, 'flickr_url': '', 'coco_url': '', 'date_captured': 0, 'bboxes': [{'bbox': [431.53, 84.4, 251.45, 105.12], 'category_id': 2, 'id': 258}, {'bbox': [990.35, 31.45, 279.31, 258.41], 'category_id': 1, 'id': 259}, {'bbox': [710.24, 4.97, 254.23, 291.86], 'category_id': 1, 'id': 260}, {'bbox': [76.18, 59.32, 336.45, 234.72], 'category_id': 1, 'id': 261}, {'bbox': [2.32, 321.3, 1343.99, 753.13], 'category_id': 4, 'id': 262}, {'bbox': [1178.47, 265.56, 56.35, 42.41], 'category_id': 3, 'id': 263}, {'bbox': [306.11, 266.96, 54.96, 41.01], 'category_id': 3, 'id': 264}, {'bbox': [431.53, 204.25, 248.66, 49.38], 'category_id': 2, 'id': 265}, {'bbox': [863.53, 271.14, 53.56, 42.41], 'category_id': 3, 'id': 266}], 'caption': 'Table 5. Comparison of the enantioselectivities of 2a and 3a, isolated from the reaction of 1a using different Au catalysts.a ', 'pdf': {'Page': 7, 'DPI': 100, 'Width': 818, 'Height': 1088, 'CaptionBB': [58, 57, 365, 81], 'ImageBB': [58, 89, 396, 359]}}, {'id': 27, 'width': 1348, 'height': 1132, 'file_name': 'ja9039289-Table-c3.png', 'license': 0, 'flickr_url': '', 'coco_url': '', 'date_captured': 0, 'bboxes': [{'bbox': [949.48, 205.43, 374.46, 47.28], 'category_id': 2, 'id': 290}, {'bbox': [1110.15, 253.63, 39.98, 41.47], 'category_id': 3, 'id': 291}, {'bbox': [1110.15, 148.46, 38.52, 42.9], 'category_id': 3, 'id': 292}, {'bbox': [743.53, 253.63, 35.59, 42.9], 'category_id': 3, 'id': 293}, {'bbox': [281.96, 222.95, 301.44, 45.82], 'category_id': 2, 'id': 294}, {'bbox': [636.9, 142.62, 254.69, 108.63], 'category_id': 1, 'id': 295}, {'bbox': [1050.26, 95.88, 155.37, 48.74], 'category_id': 2, 'id': 296}, {'bbox': [21.97, 139.7, 206.49, 107.16], 'category_id': 1, 'id': 297}, {'bbox': [2.98, 303.29, 1341.41, 827.21], 'category_id': 4, 'id': 298}, {'bbox': [298.03, 3.86, 269.3, 180.2], 'category_id': 2, 'id': 299}], 'caption': 'Table 3. Fluoride Effect on Ni- and Co-Catalyzed Biaryl Cross-Coupling in the Presence of Phosphine Ligands ', 'pdf': {'Page': 5, 'DPI': 100, 'Width': 818, 'Height': 1088, 'CaptionBB': [425, 57, 703, 81], 'ImageBB': [425, 89, 762, 372]}}, {'id': 49, 'width': 1352, 'height': 1820, 'file_name': 'ja408733f-Figure-c2.png', 'license': 0, 'flickr_url': '', 'coco_url': '', 'date_captured': 0, 'bboxes': [{'bbox': [364.33, 441.71, 98.0, 35.95], 'category_id': 2, 'id': 516}, {'bbox': [523.35, 309.95, 305.23, 242.6], 'category_id': 1, 'id': 517}, {'bbox': [856.55, 377.53, 113.92, 35.95], 'category_id': 2, 'id': 518}, {'bbox': [572.78, 216.29, 58.22, 34.88], 'category_id': 2, 'id': 519}, {'bbox': [672.5, 216.82, 83.15, 34.88], 'category_id': 2, 'id': 520}, {'bbox': [388.72, 367.98, 73.08, 36.48], 'category_id': 2, 'id': 521}, {'bbox': [522.59, 689.56, 344.18, 377.03], 'category_id': 1, 'id': 522}, {'bbox': [690.63, 565.06, 167.74, 118.86], 'category_id': 1, 'id': 523}, {'bbox': [460.72, 565.06, 167.75, 118.86], 'category_id': 1, 'id': 524}, {'bbox': [25.36, 225.93, 305.23, 327.38], 'category_id': 1, 'id': 525}, {'bbox': [1015.24, 206.07, 305.23, 346.48], 'category_id': 1, 'id': 526}, {'bbox': [391.22, 2.9, 519.85, 152.47], 'category_id': 1, 'id': 527}, {'bbox': [29.53, 1144.91, 1292.75, 668.44], 'category_id': 1, 'id': 528}], 'caption': 'Figure 2. Molecular structure of [κ4-Tptm]ZnF·H2O.', 'pdf': {'Page': 2, 'DPI': 100, 'Width': 869, 'Height': 1137, 'CaptionBB': [82, 578, 338, 595], 'ImageBB': [82, 116, 420, 571]}}, {'id': 70, 'width': 1344, 'height': 1332, 'file_name': 'ja208286b-Table-c1.png', 'license': 0, 'flickr_url': '', 'coco_url': '', 'date_captured': 0, 'bboxes': [{'bbox': [523.14, 256.74, 247.36, 173.92], 'category_id': 2, 'id': 765}, {'bbox': [4.02, 627.29, 1337.34, 307.46], 'category_id': 4, 'id': 766}, {'bbox': [207.66, 355.22, 27.04, 33.71], 'category_id': 3, 'id': 767}, {'bbox': [968.8, 71.46, 270.74, 504.42], 'category_id': 1, 'id': 768}, {'bbox': [484.74, 3.02, 305.79, 195.63], 'category_id': 1, 'id': 769}, {'bbox': [105.84, 71.46, 255.72, 275.74], 'category_id': 1, 'id': 770}, {'bbox': [695.06, 156.58, 48.74, 37.06], 'category_id': 3, 'id': 771}, {'bbox': [1167.44, 355.22, 48.73, 38.72], 'category_id': 3, 'id': 772}], 'caption': 'Table 1. Optimization Studies for the Ruthenium-Catalyzed Meta Sulfonation of 2-Phenylpyridine (1)a ', 'pdf': {'Page': 2, 'DPI': 100, 'Width': 844, 'Height': 1112, 'CaptionBB': [71, 92, 404, 122], 'ImageBB': [71, 133, 407, 466]}}, {'id': 76, 'width': 1356, 'height': 1136, 'file_name': 'ja2014746-Figure-c1.png', 'license': 0, 'flickr_url': '', 'coco_url': '', 'date_captured': 0, 'bboxes': [{'bbox': [269.68, 430.42, 20.43, 28.16], 'category_id': 3, 'id': 838}, {'bbox': [37.04, 5.39, 527.1, 139.56], 'category_id': 1, 'id': 839}, {'bbox': [6.0, 631.97, 640.29, 481.94], 'category_id': 1, 'id': 840}, {'bbox': [668.32, 622.33, 680.23, 506.73], 'category_id': 1, 'id': 841}, {'bbox': [650.89, 32.01, 86.31, 37.5], 'category_id': 2, 'id': 842}, {'bbox': [603.56, 88.22, 176.54, 62.64], 'category_id': 2, 'id': 843}, {'bbox': [631.67, 287.91, 86.31, 36.02], 'category_id': 2, 'id': 844}, {'bbox': [22.25, 240.57, 518.23, 160.27], 'category_id': 1, 'id': 845}, {'bbox': [821.0, 5.39, 501.96, 135.12], 'category_id': 1, 'id': 846}, {'bbox': [806.21, 234.66, 504.91, 163.23], 'category_id': 1, 'id': 847}, {'bbox': [584.33, 344.11, 175.06, 62.65], 'category_id': 2, 'id': 848}, {'bbox': [288.5, 148.86, 16.79, 30.11], 'category_id': 3, 'id': 849}, {'bbox': [1047.81, 429.83, 20.43, 26.37], 'category_id': 3, 'id': 850}, {'bbox': [1066.24, 151.03, 20.43, 27.56], 'category_id': 3, 'id': 851}], 'caption': 'Figure 1. (Left) ORTEP drawing of 2 (50% probability level). One of the tert-butyl groups on Si3 is disordered, and the minor contribution (occupancy factor 0.299) and hydrogen atoms are omitted for clarity. # indicates the following symmetry transformation: x, y þ 1, z. Selected bond lengths (Å) and angles (deg): Si1 Si2 = 2.3675(6), Si1 Si3 = 2.3737(6), Si1 C1 = 1.8174(14), C1 C2 = 1.423(2), C1 C3# = 1.422(2), C2 C3 = 1.3700(19). Si2 Si1 Si3 = 122.86(2), Si2 Si1 C1 = 117.52(5), Si3 Si1 C1 = 119.58(5), Si1 C1 C2 = 120.66(11), Si1 C1 C3# = 124.39(11), C2 C1 C3# = 114.94(12), C1 C2 C3 = 122.78(13), C2 C3 C1# = 122.29(13). (Right) ORTEP drawing of 4 (50% probability level). Hydrogen atoms are omitted for clarity. # indicates the following symmetry transformation: x þ 1/2, y þ 1/2, z. Selected bond lengths (Å) and angles (deg): Si1 Si2 = 2.3554(14), Si1 Si3 = 2.3524(14), Si1 C2 = 1.9108(19), C1 C2 = 1.387(3), C1 C2# = 1.387(3), C2 C3 = 1.395(5), C3 C4 = 1.386(4), C4 C3# = 1.386(4). Si2 Si1 Si3 = 122.21(5), Si2 Si1 C2 = 117.15(5), Si3 Si1 C2 = 119.29(5), C2 C1 C2# = 123.2(4), Si1 C2 C1 = 120.8(3), Si1 C2 C3 = 121.73(17), C1 C2 C3 = 117.5(2), C2 C3 C4 = 121.0(3), C3 C4 C3# = 119.7(4). ', 'pdf': {'Page': 2, 'DPI': 100, 'Width': 844, 'Height': 1112, 'CaptionBB': [71, 430, 405, 707], 'ImageBB': [71, 133, 410, 417]}}, {'id': 87, 'width': 1348, 'height': 736, 'file_name': 'ja063878k-Table-c2.png', 'license': 0, 'flickr_url': '', 'coco_url': '', 'date_captured': 0, 'bboxes': [{'bbox': [443.28, 145.42, 21.31, 30.46], 'category_id': 3, 'id': 939}, {'bbox': [630.33, 103.74, 154.49, 88.41], 'category_id': 2, 'id': 940}, {'bbox': [650.66, 38.67, 101.63, 31.48], 'category_id': 2, 'id': 941}, {'bbox': [302.99, 10.21, 229.71, 165.67], 'category_id': 1, 'id': 942}, {'bbox': [70.19, 4.11, 143.3, 169.74], 'category_id': 1, 'id': 943}, {'bbox': [8.18, 208.44, 1335.72, 517.46], 'category_id': 4, 'id': 944}, {'bbox': [853.98, 15.29, 320.19, 168.72], 'category_id': 1, 'id': 945}, {'bbox': [142.37, 146.43, 81.29, 36.57], 'category_id': 3, 'id': 946}], 'caption': 'Table 2. Alkenylation with 2-Substituted Vinylsilanes', 'pdf': {'Page': 1, 'DPI': 100, 'Width': 850, 'Height': 1100, 'CaptionBB': [440, 514, 705, 526], 'ImageBB': [439, 528, 776, 712]}}]\n"
]
}
],
"source": [
"print(combined_data['images'][0:10])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b26c4c01-9dd8-49a6-b8a7-cf43f8662c6c",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.9"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading