iomeval 0.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- iomeval-0.0.2/LICENSE +201 -0
- iomeval-0.0.2/MANIFEST.in +5 -0
- iomeval-0.0.2/PKG-INFO +245 -0
- iomeval-0.0.2/README.md +204 -0
- iomeval-0.0.2/iomeval/__init__.py +1 -0
- iomeval-0.0.2/iomeval/_modidx.py +83 -0
- iomeval-0.0.2/iomeval/core.py +22 -0
- iomeval-0.0.2/iomeval/downloaders.py +42 -0
- iomeval-0.0.2/iomeval/extract.py +63 -0
- iomeval-0.0.2/iomeval/mapper.py +96 -0
- iomeval-0.0.2/iomeval/pipeline.py +225 -0
- iomeval-0.0.2/iomeval/readers.py +173 -0
- iomeval-0.0.2/iomeval/themes.py +104 -0
- iomeval-0.0.2/iomeval.egg-info/PKG-INFO +245 -0
- iomeval-0.0.2/iomeval.egg-info/SOURCES.txt +22 -0
- iomeval-0.0.2/iomeval.egg-info/dependency_links.txt +1 -0
- iomeval-0.0.2/iomeval.egg-info/entry_points.txt +2 -0
- iomeval-0.0.2/iomeval.egg-info/not-zip-safe +1 -0
- iomeval-0.0.2/iomeval.egg-info/requires.txt +8 -0
- iomeval-0.0.2/iomeval.egg-info/top_level.txt +1 -0
- iomeval-0.0.2/pyproject.toml +3 -0
- iomeval-0.0.2/settings.ini +39 -0
- iomeval-0.0.2/setup.cfg +4 -0
- iomeval-0.0.2/setup.py +64 -0
iomeval-0.0.2/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2022, fastai
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
iomeval-0.0.2/PKG-INFO
ADDED
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: iomeval
|
|
3
|
+
Version: 0.0.2
|
|
4
|
+
Summary: IOM evaluation assistant
|
|
5
|
+
Home-page: https://github.com/franckalbinet/iomeval
|
|
6
|
+
Author: Solveit
|
|
7
|
+
Author-email: nobody@fast.ai
|
|
8
|
+
License: Apache Software License 2.0
|
|
9
|
+
Keywords: nbdev jupyter notebook python
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Natural Language :: English
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
18
|
+
Requires-Python: >=3.9
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: fastcore
|
|
22
|
+
Requires-Dist: pandas
|
|
23
|
+
Requires-Dist: lisette
|
|
24
|
+
Requires-Dist: pydantic
|
|
25
|
+
Requires-Dist: tiktoken
|
|
26
|
+
Requires-Dist: mistocr
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Dynamic: author
|
|
29
|
+
Dynamic: author-email
|
|
30
|
+
Dynamic: classifier
|
|
31
|
+
Dynamic: description
|
|
32
|
+
Dynamic: description-content-type
|
|
33
|
+
Dynamic: home-page
|
|
34
|
+
Dynamic: keywords
|
|
35
|
+
Dynamic: license
|
|
36
|
+
Dynamic: license-file
|
|
37
|
+
Dynamic: provides-extra
|
|
38
|
+
Dynamic: requires-dist
|
|
39
|
+
Dynamic: requires-python
|
|
40
|
+
Dynamic: summary
|
|
41
|
+
|
|
42
|
+
# IOMEval
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
|
|
46
|
+
|
|
47
|
+
[](https://github.com/franckalbinet/iomeval/actions/workflows/test.yaml)
|
|
48
|
+
[](https://pypi.org/project/iomeval/)
|
|
49
|
+
|
|
50
|
+
`iomeval` streamlines the mapping of [IOM](https://www.iom.int)
|
|
51
|
+
evaluation reports against strategic frameworks like the [Strategic
|
|
52
|
+
Results Framework (SRF)](https://srf.iom.int/) and [Global Compact for
|
|
53
|
+
Migration
|
|
54
|
+
(GCM)](https://www.un.org/en/development/desa/population/migration/generalassembly/docs/globalcompact/A_RES_73_195.pdf).
|
|
55
|
+
It uses LLMs to process PDF reports, extract key sections, and tag/map
|
|
56
|
+
them to framework components, turning dispersed, untagged evaluation
|
|
57
|
+
documents into structured, searchable knowledge maps.
|
|
58
|
+
|
|
59
|
+
## Why This Matters
|
|
60
|
+
|
|
61
|
+
UN agencies produce extensive evaluation reports and other public
|
|
62
|
+
documents. For IOM, this body of knowledge is extensive and variegated,
|
|
63
|
+
but putting it to practical use becomes more challenging as volume
|
|
64
|
+
increases, particularly when documentation is stored across different
|
|
65
|
+
repositories with no single index available.
|
|
66
|
+
|
|
67
|
+
**The Challenge for IOM**
|
|
68
|
+
|
|
69
|
+
IOM’s evaluation production is highly decentralized, with reports stored
|
|
70
|
+
across multiple repositories (the [IOM Evaluation
|
|
71
|
+
Repository](https://evaluation.iom.int/evaluation-search-pdf), IOM
|
|
72
|
+
Library, IOM Protection Platform). Quality varies greatly—quality
|
|
73
|
+
control processes are not applied uniformly, and variation also reflects
|
|
74
|
+
the inherent subjectivity in evaluation approaches and interpretations.
|
|
75
|
+
Reports also vary significantly in structure: some follow common formats
|
|
76
|
+
with executive summaries, findings, and recommendations, while others
|
|
77
|
+
have different structures entirely. This inconsistency makes systematic
|
|
78
|
+
mapping challenging.
|
|
79
|
+
|
|
80
|
+
Critically, existing metadata doesn’t indicate which elements of IOM’s
|
|
81
|
+
strategic frameworks—the [Strategic Results Framework
|
|
82
|
+
(SRF)](https://srf.iom.int/) or the [Global Compact for Migration
|
|
83
|
+
(GCM)](https://www.un.org/en/development/desa/population/migration/generalassembly/docs/globalcompact/A_RES_73_195.pdf)—each
|
|
84
|
+
report addresses. This is a major gap that limits the ability to connect
|
|
85
|
+
evaluation evidence with key strategic frameworks.
|
|
86
|
+
|
|
87
|
+
**Evidence Maps as a Solution**
|
|
88
|
+
|
|
89
|
+
Evidence Maps display the extent and nature of research and evaluation
|
|
90
|
+
available on a subject. Following the 2025 UNEG Eval Week, four primary
|
|
91
|
+
use cases emerged: guiding future evidence generation, informing policy
|
|
92
|
+
decisions, knowledge management, and enhancing collaboration. The maps
|
|
93
|
+
created by `iomeval` serve primarily as **knowledge management
|
|
94
|
+
tools**—structured repositories that make identifying relevant sources
|
|
95
|
+
easier by organizing them against strategic framework components.
|
|
96
|
+
|
|
97
|
+
**What This Enables**
|
|
98
|
+
|
|
99
|
+
By tagging reports against SRF outputs, enablers, cross-cutting
|
|
100
|
+
priorities, and GCM objectives, these maps help answer questions like:
|
|
101
|
+
Which framework elements are well-covered by existing evaluations? Where
|
|
102
|
+
are the knowledge gaps that should prioritize future evaluation work?
|
|
103
|
+
Which themes have enough evidence for a dedicated synthesis report?
|
|
104
|
+
|
|
105
|
+
## Installation
|
|
106
|
+
|
|
107
|
+
``` sh
|
|
108
|
+
pip install iomeval
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Configuration
|
|
112
|
+
|
|
113
|
+
iomeval uses Claude for intelligent extraction and mapping. Set your
|
|
114
|
+
Anthropic API key:
|
|
115
|
+
|
|
116
|
+
``` sh
|
|
117
|
+
export ANTHROPIC_API_KEY='your-key-here'
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
add mistral also …
|
|
121
|
+
|
|
122
|
+
## Key Features
|
|
123
|
+
|
|
124
|
+
- **Automated PDF Processing**: Download and OCR evaluation reports with
|
|
125
|
+
proper heading hierarchy
|
|
126
|
+
- **Intelligent Section Extraction**: LLM-powered extraction of
|
|
127
|
+
executive summaries, findings, conclusions, and recommendations
|
|
128
|
+
- **Strategic Framework Mapping**: Map report content to IOM’s SRF
|
|
129
|
+
Enablers, Cross-Cutting Priorities, GCM Objectives, and SRF Outputs
|
|
130
|
+
- **Checkpoint/Resume**: Built-in state persistence - interrupt and
|
|
131
|
+
resume long-running pipelines
|
|
132
|
+
- **Granular Control**: Use the full pipeline or individual components
|
|
133
|
+
as needed
|
|
134
|
+
|
|
135
|
+
## Quick Start
|
|
136
|
+
|
|
137
|
+
Process an evaluation report end-to-end:
|
|
138
|
+
|
|
139
|
+
``` python
|
|
140
|
+
from iomeval.pipeline import Report, run_pipeline
|
|
141
|
+
|
|
142
|
+
report = Report(id="IOM-2024-001", pdf_url="evaluation_report.pdf")
|
|
143
|
+
run_pipeline(report)
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
The rich display shows processing status across all pipeline stages -
|
|
147
|
+
from OCR through framework mapping.
|
|
148
|
+
|
|
149
|
+
## Detailed Workflow
|
|
150
|
+
|
|
151
|
+
For more control, use individual pipeline stages:
|
|
152
|
+
|
|
153
|
+
### 1. Load evaluation metadata
|
|
154
|
+
|
|
155
|
+
``` python
|
|
156
|
+
from iomeval.readers import read_iom
|
|
157
|
+
|
|
158
|
+
evals = read_iom() # Returns DataFrame of all IOM evaluations
|
|
159
|
+
evals.head()
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### 2. Download and OCR a report
|
|
163
|
+
|
|
164
|
+
``` python
|
|
165
|
+
from iomeval.downloaders import download_pdf
|
|
166
|
+
from iomeval.core import pdf_to_md
|
|
167
|
+
|
|
168
|
+
# Download PDF
|
|
169
|
+
pdf_path = download_pdf(report.pdf_url, dest_folder="pdfs")
|
|
170
|
+
|
|
171
|
+
# Convert to markdown with heading hierarchy
|
|
172
|
+
report.md = pdf_to_md(pdf_path)
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### 3. Extract key sections
|
|
176
|
+
|
|
177
|
+
``` python
|
|
178
|
+
from iomeval.extract import extract_exec_summary, extract_findings, extract_conclusions, extract_recommendations
|
|
179
|
+
|
|
180
|
+
report.exec_summary = extract_exec_summary(report.md)
|
|
181
|
+
report.findings = extract_findings(report.md)
|
|
182
|
+
report.conclusions = extract_conclusions(report.md)
|
|
183
|
+
report.recommendations = extract_recommendations(report.md)
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### 4. Map to strategic frameworks
|
|
187
|
+
|
|
188
|
+
``` python
|
|
189
|
+
from iomeval.mapper import map_srf_enablers, map_srf_crosscutting, map_gcm, map_srf_outputs
|
|
190
|
+
|
|
191
|
+
# Each mapper returns structured results with centrality scores
|
|
192
|
+
report.srf_enablers = map_srf_enablers(report.conclusions)
|
|
193
|
+
report.srf_crosscutting = map_srf_crosscutting(report.conclusions)
|
|
194
|
+
report.gcm = map_gcm(report.conclusions)
|
|
195
|
+
report.srf_outputs = map_srf_outputs(report.conclusions)
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### 5. Save/restore checkpoints
|
|
199
|
+
|
|
200
|
+
``` python
|
|
201
|
+
# Save progress
|
|
202
|
+
report.save("checkpoint.json")
|
|
203
|
+
|
|
204
|
+
# Resume later
|
|
205
|
+
report = Report.load("checkpoint.json")
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Development
|
|
209
|
+
|
|
210
|
+
iomeval is built with [nbdev](https://nbdev.fast.ai/), which means the
|
|
211
|
+
entire library is developed in Jupyter notebooks. The notebooks serve as
|
|
212
|
+
both documentation and source code.
|
|
213
|
+
|
|
214
|
+
### Setup for development
|
|
215
|
+
|
|
216
|
+
``` sh
|
|
217
|
+
git clone https://github.com/franckalbinet/iomeval.git
|
|
218
|
+
cd iomeval
|
|
219
|
+
pip install -e '.[dev]'
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### Key nbdev commands
|
|
223
|
+
|
|
224
|
+
``` sh
|
|
225
|
+
nbdev_test # Run tests in notebooks
|
|
226
|
+
nbdev_export # Export notebooks to Python modules
|
|
227
|
+
nbdev_preview # Preview documentation site
|
|
228
|
+
nbdev_prepare # Export, test, and clean notebooks (run before committing)
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Workflow
|
|
232
|
+
|
|
233
|
+
1. Make changes in the `.ipynb` notebook files
|
|
234
|
+
2. Run `nbdev_prepare` to export code and run tests
|
|
235
|
+
3. Commit both notebooks and exported Python files
|
|
236
|
+
4. Documentation is automatically generated from the notebooks
|
|
237
|
+
|
|
238
|
+
Learn more about nbdev’s literate programming approach in the [nbdev
|
|
239
|
+
documentation](https://nbdev.fast.ai/).
|
|
240
|
+
|
|
241
|
+
### Contributing
|
|
242
|
+
|
|
243
|
+
Contributions are welcome! Please: - Follow the existing notebook
|
|
244
|
+
structure - Add tests using nbdev’s `#| test` cells - Run
|
|
245
|
+
`nbdev_prepare` before submitting PRs
|
iomeval-0.0.2/README.md
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# IOMEval
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
|
|
5
|
+
|
|
6
|
+
[](https://github.com/franckalbinet/iomeval/actions/workflows/test.yaml)
|
|
7
|
+
[](https://pypi.org/project/iomeval/)
|
|
8
|
+
|
|
9
|
+
`iomeval` streamlines the mapping of [IOM](https://www.iom.int)
|
|
10
|
+
evaluation reports against strategic frameworks like the [Strategic
|
|
11
|
+
Results Framework (SRF)](https://srf.iom.int/) and [Global Compact for
|
|
12
|
+
Migration
|
|
13
|
+
(GCM)](https://www.un.org/en/development/desa/population/migration/generalassembly/docs/globalcompact/A_RES_73_195.pdf).
|
|
14
|
+
It uses LLMs to process PDF reports, extract key sections, and tag/map
|
|
15
|
+
them to framework components, turning dispersed, untagged evaluation
|
|
16
|
+
documents into structured, searchable knowledge maps.
|
|
17
|
+
|
|
18
|
+
## Why This Matters
|
|
19
|
+
|
|
20
|
+
UN agencies produce extensive evaluation reports and other public
|
|
21
|
+
documents. For IOM, this body of knowledge is extensive and variegated,
|
|
22
|
+
but putting it to practical use becomes more challenging as volume
|
|
23
|
+
increases, particularly when documentation is stored across different
|
|
24
|
+
repositories with no single index available.
|
|
25
|
+
|
|
26
|
+
**The Challenge for IOM**
|
|
27
|
+
|
|
28
|
+
IOM’s evaluation production is highly decentralized, with reports stored
|
|
29
|
+
across multiple repositories (the [IOM Evaluation
|
|
30
|
+
Repository](https://evaluation.iom.int/evaluation-search-pdf), IOM
|
|
31
|
+
Library, IOM Protection Platform). Quality varies greatly—quality
|
|
32
|
+
control processes are not applied uniformly, and variation also reflects
|
|
33
|
+
the inherent subjectivity in evaluation approaches and interpretations.
|
|
34
|
+
Reports also vary significantly in structure: some follow common formats
|
|
35
|
+
with executive summaries, findings, and recommendations, while others
|
|
36
|
+
have different structures entirely. This inconsistency makes systematic
|
|
37
|
+
mapping challenging.
|
|
38
|
+
|
|
39
|
+
Critically, existing metadata doesn’t indicate which elements of IOM’s
|
|
40
|
+
strategic frameworks—the [Strategic Results Framework
|
|
41
|
+
(SRF)](https://srf.iom.int/) or the [Global Compact for Migration
|
|
42
|
+
(GCM)](https://www.un.org/en/development/desa/population/migration/generalassembly/docs/globalcompact/A_RES_73_195.pdf)—each
|
|
43
|
+
report addresses. This is a major gap that limits the ability to connect
|
|
44
|
+
evaluation evidence with key strategic frameworks.
|
|
45
|
+
|
|
46
|
+
**Evidence Maps as a Solution**
|
|
47
|
+
|
|
48
|
+
Evidence Maps display the extent and nature of research and evaluation
|
|
49
|
+
available on a subject. Following the 2025 UNEG Eval Week, four primary
|
|
50
|
+
use cases emerged: guiding future evidence generation, informing policy
|
|
51
|
+
decisions, knowledge management, and enhancing collaboration. The maps
|
|
52
|
+
created by `iomeval` serve primarily as **knowledge management
|
|
53
|
+
tools**—structured repositories that make identifying relevant sources
|
|
54
|
+
easier by organizing them against strategic framework components.
|
|
55
|
+
|
|
56
|
+
**What This Enables**
|
|
57
|
+
|
|
58
|
+
By tagging reports against SRF outputs, enablers, cross-cutting
|
|
59
|
+
priorities, and GCM objectives, these maps help answer questions like:
|
|
60
|
+
Which framework elements are well-covered by existing evaluations? Where
|
|
61
|
+
are the knowledge gaps that should prioritize future evaluation work?
|
|
62
|
+
Which themes have enough evidence for a dedicated synthesis report?
|
|
63
|
+
|
|
64
|
+
## Installation
|
|
65
|
+
|
|
66
|
+
``` sh
|
|
67
|
+
pip install iomeval
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Configuration
|
|
71
|
+
|
|
72
|
+
iomeval uses Claude for intelligent extraction and mapping. Set your
|
|
73
|
+
Anthropic API key:
|
|
74
|
+
|
|
75
|
+
``` sh
|
|
76
|
+
export ANTHROPIC_API_KEY='your-key-here'
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
add mistral also …
|
|
80
|
+
|
|
81
|
+
## Key Features
|
|
82
|
+
|
|
83
|
+
- **Automated PDF Processing**: Download and OCR evaluation reports with
|
|
84
|
+
proper heading hierarchy
|
|
85
|
+
- **Intelligent Section Extraction**: LLM-powered extraction of
|
|
86
|
+
executive summaries, findings, conclusions, and recommendations
|
|
87
|
+
- **Strategic Framework Mapping**: Map report content to IOM’s SRF
|
|
88
|
+
Enablers, Cross-Cutting Priorities, GCM Objectives, and SRF Outputs
|
|
89
|
+
- **Checkpoint/Resume**: Built-in state persistence - interrupt and
|
|
90
|
+
resume long-running pipelines
|
|
91
|
+
- **Granular Control**: Use the full pipeline or individual components
|
|
92
|
+
as needed
|
|
93
|
+
|
|
94
|
+
## Quick Start
|
|
95
|
+
|
|
96
|
+
Process an evaluation report end-to-end:
|
|
97
|
+
|
|
98
|
+
``` python
|
|
99
|
+
from iomeval.pipeline import Report, run_pipeline
|
|
100
|
+
|
|
101
|
+
report = Report(id="IOM-2024-001", pdf_url="evaluation_report.pdf")
|
|
102
|
+
run_pipeline(report)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
The rich display shows processing status across all pipeline stages -
|
|
106
|
+
from OCR through framework mapping.
|
|
107
|
+
|
|
108
|
+
## Detailed Workflow
|
|
109
|
+
|
|
110
|
+
For more control, use individual pipeline stages:
|
|
111
|
+
|
|
112
|
+
### 1. Load evaluation metadata
|
|
113
|
+
|
|
114
|
+
``` python
|
|
115
|
+
from iomeval.readers import read_iom
|
|
116
|
+
|
|
117
|
+
evals = read_iom() # Returns DataFrame of all IOM evaluations
|
|
118
|
+
evals.head()
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 2. Download and OCR a report
|
|
122
|
+
|
|
123
|
+
``` python
|
|
124
|
+
from iomeval.downloaders import download_pdf
|
|
125
|
+
from iomeval.core import pdf_to_md
|
|
126
|
+
|
|
127
|
+
# Download PDF
|
|
128
|
+
pdf_path = download_pdf(report.pdf_url, dest_folder="pdfs")
|
|
129
|
+
|
|
130
|
+
# Convert to markdown with heading hierarchy
|
|
131
|
+
report.md = pdf_to_md(pdf_path)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### 3. Extract key sections
|
|
135
|
+
|
|
136
|
+
``` python
|
|
137
|
+
from iomeval.extract import extract_exec_summary, extract_findings, extract_conclusions, extract_recommendations
|
|
138
|
+
|
|
139
|
+
report.exec_summary = extract_exec_summary(report.md)
|
|
140
|
+
report.findings = extract_findings(report.md)
|
|
141
|
+
report.conclusions = extract_conclusions(report.md)
|
|
142
|
+
report.recommendations = extract_recommendations(report.md)
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### 4. Map to strategic frameworks
|
|
146
|
+
|
|
147
|
+
``` python
|
|
148
|
+
from iomeval.mapper import map_srf_enablers, map_srf_crosscutting, map_gcm, map_srf_outputs
|
|
149
|
+
|
|
150
|
+
# Each mapper returns structured results with centrality scores
|
|
151
|
+
report.srf_enablers = map_srf_enablers(report.conclusions)
|
|
152
|
+
report.srf_crosscutting = map_srf_crosscutting(report.conclusions)
|
|
153
|
+
report.gcm = map_gcm(report.conclusions)
|
|
154
|
+
report.srf_outputs = map_srf_outputs(report.conclusions)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### 5. Save/restore checkpoints
|
|
158
|
+
|
|
159
|
+
``` python
|
|
160
|
+
# Save progress
|
|
161
|
+
report.save("checkpoint.json")
|
|
162
|
+
|
|
163
|
+
# Resume later
|
|
164
|
+
report = Report.load("checkpoint.json")
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Development
|
|
168
|
+
|
|
169
|
+
iomeval is built with [nbdev](https://nbdev.fast.ai/), which means the
|
|
170
|
+
entire library is developed in Jupyter notebooks. The notebooks serve as
|
|
171
|
+
both documentation and source code.
|
|
172
|
+
|
|
173
|
+
### Setup for development
|
|
174
|
+
|
|
175
|
+
``` sh
|
|
176
|
+
git clone https://github.com/franckalbinet/iomeval.git
|
|
177
|
+
cd iomeval
|
|
178
|
+
pip install -e '.[dev]'
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Key nbdev commands
|
|
182
|
+
|
|
183
|
+
``` sh
|
|
184
|
+
nbdev_test # Run tests in notebooks
|
|
185
|
+
nbdev_export # Export notebooks to Python modules
|
|
186
|
+
nbdev_preview # Preview documentation site
|
|
187
|
+
nbdev_prepare # Export, test, and clean notebooks (run before committing)
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Workflow
|
|
191
|
+
|
|
192
|
+
1. Make changes in the `.ipynb` notebook files
|
|
193
|
+
2. Run `nbdev_prepare` to export code and run tests
|
|
194
|
+
3. Commit both notebooks and exported Python files
|
|
195
|
+
4. Documentation is automatically generated from the notebooks
|
|
196
|
+
|
|
197
|
+
Learn more about nbdev’s literate programming approach in the [nbdev
|
|
198
|
+
documentation](https://nbdev.fast.ai/).
|
|
199
|
+
|
|
200
|
+
### Contributing
|
|
201
|
+
|
|
202
|
+
Contributions are welcome! Please: - Follow the existing notebook
|
|
203
|
+
structure - Add tests using nbdev’s `#| test` cells - Run
|
|
204
|
+
`nbdev_prepare` before submitting PRs
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.2"
|