Skip to content

Commit

Permalink
Updated TR and AMR linking examples (#52)
Browse files Browse the repository at this point in the history
* Updated the TR notebook to conform to the current state of the API

* Added an example of an AMR to link to the TR notebook

* Updated the README.md file and the AMR linking notebook
  • Loading branch information
enoriega authored Mar 22, 2024
1 parent 06cddfc commit f18c5d2
Show file tree
Hide file tree
Showing 7 changed files with 656 additions and 362 deletions.
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,19 @@ Run `docker compose up` and after both pipelines have finished, the `outputs` di

## Text Reading

The client code for both SKEMA and MIT text reading pipelines is available in `end-to-end-rest/notebooks/text_reading/text_reading_pipeline.ipynb`
The client code for both SKEMA and MIT text reading pipelines is available in `end-to-end-rest/notebooks/text_reading_pipeline.ipynb`

To call the unified pipeline use `integrated_text_extractions`.
This notebook contains examples of how to annotate:
- PDFs
- Plain text files
- Call the embedding based MIRA grounding.

### Example
```python
# Read a paper from the example directory
test_text = open("1-s2.0-S2211379721005490-main.txt").read()
Additionally, the variable extraction endpoints support an optional `AMR` file that will be linked with the variables extracted at the end of extraction. See the PDF annotation example for reference.

# Run the integrated pipeline
extractions = integrated_text_extractions(test_text)
## AMR alignment

The notebook `end-to-end-rest/notebooks/text_reading/metal.ipynb` contains an example of how to call the AMR linking endpoint if you have a file with variable extractions and a pre-existing AMR.

# Print the result
for attribute in extractions[0].attributes:
print(attribute)
```

## Eqn2AMR

Expand Down
Empty file removed end-to-end-rest/code/__init__.py
Empty file.
145 changes: 0 additions & 145 deletions end-to-end-rest/code/integrated-tr-rest.py

This file was deleted.

Loading

0 comments on commit f18c5d2

Please sign in to comment.