keybridge 1.0.0__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.
Files changed (41) hide show
  1. keybridge-1.0.0/LICENSE +28 -0
  2. keybridge-1.0.0/LICENSE-CC-BY-4.0.txt +415 -0
  3. keybridge-1.0.0/PKG-INFO +82 -0
  4. keybridge-1.0.0/README.md +63 -0
  5. keybridge-1.0.0/pyproject.toml +34 -0
  6. keybridge-1.0.0/setup.cfg +4 -0
  7. keybridge-1.0.0/src/keybridge/__init__.py +6 -0
  8. keybridge-1.0.0/src/keybridge/__main__.py +3 -0
  9. keybridge-1.0.0/src/keybridge/cli.py +329 -0
  10. keybridge-1.0.0/src/keybridge/colab.py +79 -0
  11. keybridge-1.0.0/src/keybridge/common.py +72 -0
  12. keybridge-1.0.0/src/keybridge/config.py +36 -0
  13. keybridge-1.0.0/src/keybridge/convert.py +54 -0
  14. keybridge-1.0.0/src/keybridge/data.py +289 -0
  15. keybridge-1.0.0/src/keybridge/evaluate.py +261 -0
  16. keybridge-1.0.0/src/keybridge/keys.py +236 -0
  17. keybridge-1.0.0/src/keybridge/language_profiles/cz.json.gz +0 -0
  18. keybridge-1.0.0/src/keybridge/language_profiles/de.json.gz +0 -0
  19. keybridge-1.0.0/src/keybridge/language_profiles/en.json.gz +0 -0
  20. keybridge-1.0.0/src/keybridge/language_profiles/es.json.gz +0 -0
  21. keybridge-1.0.0/src/keybridge/language_profiles/fr.json.gz +0 -0
  22. keybridge-1.0.0/src/keybridge/language_profiles/hu.json.gz +0 -0
  23. keybridge-1.0.0/src/keybridge/language_profiles/is.json.gz +0 -0
  24. keybridge-1.0.0/src/keybridge/language_profiles/it.json.gz +0 -0
  25. keybridge-1.0.0/src/keybridge/language_profiles/la.json.gz +0 -0
  26. keybridge-1.0.0/src/keybridge/language_profiles/nl.json.gz +0 -0
  27. keybridge-1.0.0/src/keybridge/language_profiles/pl.json.gz +0 -0
  28. keybridge-1.0.0/src/keybridge/language_profiles/sl.json.gz +0 -0
  29. keybridge-1.0.0/src/keybridge/language_profiles/sv.json.gz +0 -0
  30. keybridge-1.0.0/src/keybridge/languages.py +169 -0
  31. keybridge-1.0.0/src/keybridge/model.py +219 -0
  32. keybridge-1.0.0/src/keybridge/pipeline.py +381 -0
  33. keybridge-1.0.0/src/keybridge/registry.py +130 -0
  34. keybridge-1.0.0/src/keybridge/scan.py +159 -0
  35. keybridge-1.0.0/src/keybridge/transcription.py +30 -0
  36. keybridge-1.0.0/src/keybridge.egg-info/PKG-INFO +82 -0
  37. keybridge-1.0.0/src/keybridge.egg-info/SOURCES.txt +39 -0
  38. keybridge-1.0.0/src/keybridge.egg-info/dependency_links.txt +1 -0
  39. keybridge-1.0.0/src/keybridge.egg-info/entry_points.txt +2 -0
  40. keybridge-1.0.0/src/keybridge.egg-info/requires.txt +7 -0
  41. keybridge-1.0.0/src/keybridge.egg-info/top_level.txt +1 -0
@@ -0,0 +1,28 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Micaella Bruton, Meriem Beloucif, Beáta Megyesi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ This MIT licence covers the source code: src/keybridge/*.py, tools/ and notebooks/.
26
+ Trained models, keys, language profiles (src/keybridge/language_profiles/) and
27
+ documentation (docs/, README.md, examples/) are licensed under CC BY 4.0; see
28
+ LICENSE-CC-BY-4.0.txt.
@@ -0,0 +1,415 @@
1
+ Copyright (c) 2026 Micaella Bruton, Meriem Beloucif, Beáta Megyesi
2
+
3
+ The following are licensed under the Creative Commons Attribution 4.0 International
4
+ License (CC BY 4.0):
5
+ - trained models and their index (the Hugging Face model collection),
6
+ - keys in examples/ and in the model collection,
7
+ - language profiles in src/keybridge/language_profiles/,
8
+ - documentation: README.md and docs/.
9
+
10
+ You are free to share and adapt them for any purpose, even commercially, provided that you
11
+ give appropriate credit (please cite the publication given in CITATION.cff), provide a link
12
+ to the licence, and indicate if changes were made.
13
+
14
+ Licence summary: https://creativecommons.org/licenses/by/4.0/
15
+ Full legal code: https://creativecommons.org/licenses/by/4.0/legalcode
16
+
17
+ =======================================================================
18
+ Full legal code
19
+ =======================================================================
20
+
21
+ Attribution 4.0 International
22
+
23
+ =======================================================================
24
+
25
+ Creative Commons Corporation ("Creative Commons") is not a law firm and
26
+ does not provide legal services or legal advice. Distribution of
27
+ Creative Commons public licenses does not create a lawyer-client or
28
+ other relationship. Creative Commons makes its licenses and related
29
+ information available on an "as-is" basis. Creative Commons gives no
30
+ warranties regarding its licenses, any material licensed under their
31
+ terms and conditions, or any related information. Creative Commons
32
+ disclaims all liability for damages resulting from their use to the
33
+ fullest extent possible.
34
+
35
+ Using Creative Commons Public Licenses
36
+
37
+ Creative Commons public licenses provide a standard set of terms and
38
+ conditions that creators and other rights holders may use to share
39
+ original works of authorship and other material subject to copyright
40
+ and certain other rights specified in the public license below. The
41
+ following considerations are for informational purposes only, are not
42
+ exhaustive, and do not form part of our licenses.
43
+
44
+ Considerations for licensors: Our public licenses are
45
+ intended for use by those authorized to give the public
46
+ permission to use material in ways otherwise restricted by
47
+ copyright and certain other rights. Our licenses are
48
+ irrevocable. Licensors should read and understand the terms
49
+ and conditions of the license they choose before applying it.
50
+ Licensors should also secure all rights necessary before
51
+ applying our licenses so that the public can reuse the
52
+ material as expected. Licensors should clearly mark any
53
+ material not subject to the license. This includes other CC-
54
+ licensed material, or material used under an exception or
55
+ limitation to copyright. More considerations for licensors:
56
+ wiki.creativecommons.org/Considerations_for_licensors
57
+
58
+ Considerations for the public: By using one of our public
59
+ licenses, a licensor grants the public permission to use the
60
+ licensed material under specified terms and conditions. If
61
+ the licensor's permission is not necessary for any reason--for
62
+ example, because of any applicable exception or limitation to
63
+ copyright--then that use is not regulated by the license. Our
64
+ licenses grant only permissions under copyright and certain
65
+ other rights that a licensor has authority to grant. Use of
66
+ the licensed material may still be restricted for other
67
+ reasons, including because others have copyright or other
68
+ rights in the material. A licensor may make special requests,
69
+ such as asking that all changes be marked or described.
70
+ Although not required by our licenses, you are encouraged to
71
+ respect those requests where reasonable. More considerations
72
+ for the public:
73
+ wiki.creativecommons.org/Considerations_for_licensees
74
+
75
+ =======================================================================
76
+
77
+ Creative Commons Attribution 4.0 International Public License
78
+
79
+ By exercising the Licensed Rights (defined below), You accept and agree
80
+ to be bound by the terms and conditions of this Creative Commons
81
+ Attribution 4.0 International Public License ("Public License"). To the
82
+ extent this Public License may be interpreted as a contract, You are
83
+ granted the Licensed Rights in consideration of Your acceptance of
84
+ these terms and conditions, and the Licensor grants You such rights in
85
+ consideration of benefits the Licensor receives from making the
86
+ Licensed Material available under these terms and conditions.
87
+
88
+
89
+ Section 1 -- Definitions.
90
+
91
+ a. Adapted Material means material subject to Copyright and Similar
92
+ Rights that is derived from or based upon the Licensed Material
93
+ and in which the Licensed Material is translated, altered,
94
+ arranged, transformed, or otherwise modified in a manner requiring
95
+ permission under the Copyright and Similar Rights held by the
96
+ Licensor. For purposes of this Public License, where the Licensed
97
+ Material is a musical work, performance, or sound recording,
98
+ Adapted Material is always produced where the Licensed Material is
99
+ synched in timed relation with a moving image.
100
+
101
+ b. Adapter's License means the license You apply to Your Copyright
102
+ and Similar Rights in Your contributions to Adapted Material in
103
+ accordance with the terms and conditions of this Public License.
104
+
105
+ c. Copyright and Similar Rights means copyright and/or similar rights
106
+ closely related to copyright including, without limitation,
107
+ performance, broadcast, sound recording, and Sui Generis Database
108
+ Rights, without regard to how the rights are labeled or
109
+ categorized. For purposes of this Public License, the rights
110
+ specified in Section 2(b)(1)-(2) are not Copyright and Similar
111
+ Rights.
112
+
113
+ d. Effective Technological Measures means those measures that, in the
114
+ absence of proper authority, may not be circumvented under laws
115
+ fulfilling obligations under Article 11 of the WIPO Copyright
116
+ Treaty adopted on December 20, 1996, and/or similar international
117
+ agreements.
118
+
119
+ e. Exceptions and Limitations means fair use, fair dealing, and/or
120
+ any other exception or limitation to Copyright and Similar Rights
121
+ that applies to Your use of the Licensed Material.
122
+
123
+ f. Licensed Material means the artistic or literary work, database,
124
+ or other material to which the Licensor applied this Public
125
+ License.
126
+
127
+ g. Licensed Rights means the rights granted to You subject to the
128
+ terms and conditions of this Public License, which are limited to
129
+ all Copyright and Similar Rights that apply to Your use of the
130
+ Licensed Material and that the Licensor has authority to license.
131
+
132
+ h. Licensor means the individual(s) or entity(ies) granting rights
133
+ under this Public License.
134
+
135
+ i. Share means to provide material to the public by any means or
136
+ process that requires permission under the Licensed Rights, such
137
+ as reproduction, public display, public performance, distribution,
138
+ dissemination, communication, or importation, and to make material
139
+ available to the public including in ways that members of the
140
+ public may access the material from a place and at a time
141
+ individually chosen by them.
142
+
143
+ j. Sui Generis Database Rights means rights other than copyright
144
+ resulting from Directive 96/9/EC of the European Parliament and of
145
+ the Council of 11 March 1996 on the legal protection of databases,
146
+ as amended and/or succeeded, as well as other essentially
147
+ equivalent rights anywhere in the world.
148
+
149
+ k. You means the individual or entity exercising the Licensed Rights
150
+ under this Public License. Your has a corresponding meaning.
151
+
152
+
153
+ Section 2 -- Scope.
154
+
155
+ a. License grant.
156
+
157
+ 1. Subject to the terms and conditions of this Public License,
158
+ the Licensor hereby grants You a worldwide, royalty-free,
159
+ non-sublicensable, non-exclusive, irrevocable license to
160
+ exercise the Licensed Rights in the Licensed Material to:
161
+
162
+ a. reproduce and Share the Licensed Material, in whole or
163
+ in part; and
164
+
165
+ b. produce, reproduce, and Share Adapted Material.
166
+
167
+ 2. Exceptions and Limitations. For the avoidance of doubt, where
168
+ Exceptions and Limitations apply to Your use, this Public
169
+ License does not apply, and You do not need to comply with
170
+ its terms and conditions.
171
+
172
+ 3. Term. The term of this Public License is specified in Section
173
+ 6(a).
174
+
175
+ 4. Media and formats; technical modifications allowed. The
176
+ Licensor authorizes You to exercise the Licensed Rights in
177
+ all media and formats whether now known or hereafter created,
178
+ and to make technical modifications necessary to do so. The
179
+ Licensor waives and/or agrees not to assert any right or
180
+ authority to forbid You from making technical modifications
181
+ necessary to exercise the Licensed Rights, including
182
+ technical modifications necessary to circumvent Effective
183
+ Technological Measures. For purposes of this Public License,
184
+ simply making modifications authorized by this Section 2(a)
185
+ (4) never produces Adapted Material.
186
+
187
+ 5. Downstream recipients.
188
+
189
+ a. Offer from the Licensor -- Licensed Material. Every
190
+ recipient of the Licensed Material automatically
191
+ receives an offer from the Licensor to exercise the
192
+ Licensed Rights under the terms and conditions of this
193
+ Public License.
194
+
195
+ b. No downstream restrictions. You may not offer or impose
196
+ any additional or different terms or conditions on, or
197
+ apply any Effective Technological Measures to, the
198
+ Licensed Material if doing so restricts exercise of the
199
+ Licensed Rights by any recipient of the Licensed
200
+ Material.
201
+
202
+ 6. No endorsement. Nothing in this Public License constitutes or
203
+ may be construed as permission to assert or imply that You
204
+ are, or that Your use of the Licensed Material is, connected
205
+ with, or sponsored, endorsed, or granted official status by,
206
+ the Licensor or others designated to receive attribution as
207
+ provided in Section 3(a)(1)(A)(i).
208
+
209
+ b. Other rights.
210
+
211
+ 1. Moral rights, such as the right of integrity, are not
212
+ licensed under this Public License, nor are publicity,
213
+ privacy, and/or other similar personality rights; however, to
214
+ the extent possible, the Licensor waives and/or agrees not to
215
+ assert any such rights held by the Licensor to the limited
216
+ extent necessary to allow You to exercise the Licensed
217
+ Rights, but not otherwise.
218
+
219
+ 2. Patent and trademark rights are not licensed under this
220
+ Public License.
221
+
222
+ 3. To the extent possible, the Licensor waives any right to
223
+ collect royalties from You for the exercise of the Licensed
224
+ Rights, whether directly or through a collecting society
225
+ under any voluntary or waivable statutory or compulsory
226
+ licensing scheme. In all other cases the Licensor expressly
227
+ reserves any right to collect such royalties.
228
+
229
+
230
+ Section 3 -- License Conditions.
231
+
232
+ Your exercise of the Licensed Rights is expressly made subject to the
233
+ following conditions.
234
+
235
+ a. Attribution.
236
+
237
+ 1. If You Share the Licensed Material (including in modified
238
+ form), You must:
239
+
240
+ a. retain the following if it is supplied by the Licensor
241
+ with the Licensed Material:
242
+
243
+ i. identification of the creator(s) of the Licensed
244
+ Material and any others designated to receive
245
+ attribution, in any reasonable manner requested by
246
+ the Licensor (including by pseudonym if
247
+ designated);
248
+
249
+ ii. a copyright notice;
250
+
251
+ iii. a notice that refers to this Public License;
252
+
253
+ iv. a notice that refers to the disclaimer of
254
+ warranties;
255
+
256
+ v. a URI or hyperlink to the Licensed Material to the
257
+ extent reasonably practicable;
258
+
259
+ b. indicate if You modified the Licensed Material and
260
+ retain an indication of any previous modifications; and
261
+
262
+ c. indicate the Licensed Material is licensed under this
263
+ Public License, and include the text of, or the URI or
264
+ hyperlink to, this Public License.
265
+
266
+ 2. You may satisfy the conditions in Section 3(a)(1) in any
267
+ reasonable manner based on the medium, means, and context in
268
+ which You Share the Licensed Material. For example, it may be
269
+ reasonable to satisfy the conditions by providing a URI or
270
+ hyperlink to a resource that includes the required
271
+ information.
272
+
273
+ 3. If requested by the Licensor, You must remove any of the
274
+ information required by Section 3(a)(1)(A) to the extent
275
+ reasonably practicable.
276
+
277
+ 4. If You Share Adapted Material You produce, the Adapter's
278
+ License You apply must not prevent recipients of the Adapted
279
+ Material from complying with this Public License.
280
+
281
+
282
+ Section 4 -- Sui Generis Database Rights.
283
+
284
+ Where the Licensed Rights include Sui Generis Database Rights that
285
+ apply to Your use of the Licensed Material:
286
+
287
+ a. for the avoidance of doubt, Section 2(a)(1) grants You the right
288
+ to extract, reuse, reproduce, and Share all or a substantial
289
+ portion of the contents of the database;
290
+
291
+ b. if You include all or a substantial portion of the database
292
+ contents in a database in which You have Sui Generis Database
293
+ Rights, then the database in which You have Sui Generis Database
294
+ Rights (but not its individual contents) is Adapted Material; and
295
+
296
+ c. You must comply with the conditions in Section 3(a) if You Share
297
+ all or a substantial portion of the contents of the database.
298
+
299
+ For the avoidance of doubt, this Section 4 supplements and does not
300
+ replace Your obligations under this Public License where the Licensed
301
+ Rights include other Copyright and Similar Rights.
302
+
303
+
304
+ Section 5 -- Disclaimer of Warranties and Limitation of Liability.
305
+
306
+ a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
307
+ EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
308
+ AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
309
+ ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
310
+ IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
311
+ WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
312
+ PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
313
+ ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
314
+ KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
315
+ ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
316
+
317
+ b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
318
+ TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
319
+ NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
320
+ INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
321
+ COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
322
+ USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
323
+ ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
324
+ DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
325
+ IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
326
+
327
+ c. The disclaimer of warranties and limitation of liability provided
328
+ above shall be interpreted in a manner that, to the extent
329
+ possible, most closely approximates an absolute disclaimer and
330
+ waiver of all liability.
331
+
332
+
333
+ Section 6 -- Term and Termination.
334
+
335
+ a. This Public License applies for the term of the Copyright and
336
+ Similar Rights licensed here. However, if You fail to comply with
337
+ this Public License, then Your rights under this Public License
338
+ terminate automatically.
339
+
340
+ b. Where Your right to use the Licensed Material has terminated under
341
+ Section 6(a), it reinstates:
342
+
343
+ 1. automatically as of the date the violation is cured, provided
344
+ it is cured within 30 days of Your discovery of the
345
+ violation; or
346
+
347
+ 2. upon express reinstatement by the Licensor.
348
+
349
+ For the avoidance of doubt, this Section 6(b) does not affect any
350
+ right the Licensor may have to seek remedies for Your violations
351
+ of this Public License.
352
+
353
+ c. For the avoidance of doubt, the Licensor may also offer the
354
+ Licensed Material under separate terms or conditions or stop
355
+ distributing the Licensed Material at any time; however, doing so
356
+ will not terminate this Public License.
357
+
358
+ d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
359
+ License.
360
+
361
+
362
+ Section 7 -- Other Terms and Conditions.
363
+
364
+ a. The Licensor shall not be bound by any additional or different
365
+ terms or conditions communicated by You unless expressly agreed.
366
+
367
+ b. Any arrangements, understandings, or agreements regarding the
368
+ Licensed Material not stated herein are separate from and
369
+ independent of the terms and conditions of this Public License.
370
+
371
+
372
+ Section 8 -- Interpretation.
373
+
374
+ a. For the avoidance of doubt, this Public License does not, and
375
+ shall not be interpreted to, reduce, limit, restrict, or impose
376
+ conditions on any use of the Licensed Material that could lawfully
377
+ be made without permission under this Public License.
378
+
379
+ b. To the extent possible, if any provision of this Public License is
380
+ deemed unenforceable, it shall be automatically reformed to the
381
+ minimum extent necessary to make it enforceable. If the provision
382
+ cannot be reformed, it shall be severed from this Public License
383
+ without affecting the enforceability of the remaining terms and
384
+ conditions.
385
+
386
+ c. No term or condition of this Public License will be waived and no
387
+ failure to comply consented to unless expressly agreed to by the
388
+ Licensor.
389
+
390
+ d. Nothing in this Public License constitutes or may be interpreted
391
+ as a limitation upon, or waiver of, any privileges and immunities
392
+ that apply to the Licensor or You, including from the legal
393
+ processes of any jurisdiction or authority.
394
+
395
+
396
+ =======================================================================
397
+
398
+ Creative Commons is not a party to its public
399
+ licenses. Notwithstanding, Creative Commons may elect to apply one of
400
+ its public licenses to material it publishes and in those instances
401
+ will be considered the “Licensor.” The text of the Creative Commons
402
+ public licenses is dedicated to the public domain under the CC0 Public
403
+ Domain Dedication. Except for the limited purpose of indicating that
404
+ material is shared under a Creative Commons public license or as
405
+ otherwise permitted by the Creative Commons policies published at
406
+ creativecommons.org/policies, Creative Commons does not authorize the
407
+ use of the trademark "Creative Commons" or any other trademark or logo
408
+ of Creative Commons without its prior written consent including,
409
+ without limitation, in connection with any unauthorized modifications
410
+ to any of its public licenses or any other arrangements,
411
+ understandings, or agreements concerning use of licensed material. For
412
+ the avoidance of doubt, this paragraph does not form part of the
413
+ public licenses.
414
+
415
+ Creative Commons may be contacted at creativecommons.org.
@@ -0,0 +1,82 @@
1
+ Metadata-Version: 2.4
2
+ Name: keybridge
3
+ Version: 1.0.0
4
+ Summary: Shared-space neural decipherment of historical simple and homophonic substitution ciphers
5
+ Author: Micaella Bruton, Meriem Beloucif, Beáta Megyesi
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/mbruton0426/keybridge
8
+ Requires-Python: >=3.9
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ License-File: LICENSE-CC-BY-4.0.txt
12
+ Requires-Dist: torch>=2.1
13
+ Requires-Dist: scikit-learn>=1.0
14
+ Requires-Dist: huggingface_hub>=0.20
15
+ Requires-Dist: datasets>=2.14
16
+ Requires-Dist: optuna>=3.0
17
+ Provides-Extra: search
18
+ Dynamic: license-file
19
+
20
+ # keybridge: neural decipherment of historical simple and homophonic substitution ciphers
21
+
22
+ Archives hold many cipher keys whose ciphertexts have never been identified, and many ciphertexts whose keys are unknown. This tool helps connect the two. For a **known key**, it trains a small neural network on synthetic examples. That network then reads authentic ciphertexts written with the key, and fails visibly on ciphertexts written with other keys.
23
+
24
+ The method and its evaluation are described in: *[citation to be added]* <!-- PLACEHOLDER -->
25
+
26
+ ## Three ways to use it
27
+
28
+ | | What it does | Where it runs |
29
+ |-|--------------|---------------|
30
+ | **① Train a model for your key** | You provide a key and plaintext in the cipher's language; you get a trained model and, optionally, a draft decipherment of your transcription. | [Open in Colab](https://colab.research.google.com/github/mbruton0426/keybridge/blob/main/notebooks/1_train_your_own_model.ipynb) · [Guide](docs/TRAINING_GUIDE.md) |
31
+ | **② Read or scan a ciphertext** | Runs your transcription through one model, or all models in the shared collection. Ranks which keys it fits and which language the result reads like. | [Open in Colab](https://colab.research.google.com/github/mbruton0426/keybridge/blob/main/notebooks/2_read_or_scan_a_ciphertext.ipynb) · [Guide](docs/READING_AND_SCANNING_GUIDE.md) |
32
+ | **Local version** | The same as ① and ② from the command line, entirely on your own computer. It can run fully offline. | [Install and use](docs/LOCAL_INSTALL.md) |
33
+
34
+ The Colab notebooks need only a Google account and a web browser. Nothing has to be installed, and no code has to be written. Keys and transcriptions are simple text files in one standard format (symbols separated by spaces): see **[Key file format](docs/KEY_FORMAT.md)** and **[Transcription format](docs/TRANSCRIPTION_FORMAT.md)**.
35
+
36
+ For research use, `keybridge evaluate` scores a model's reading of an authentic ciphertext against its key (F1 with confidence intervals), as reported in the paper; see [LOCAL_INSTALL.md](docs/LOCAL_INSTALL.md#score-a-reading-against-the-key-research).
37
+
38
+ ## What it can and cannot do
39
+
40
+ **It can**
41
+ - produce **draft decipherments** of transcribed ciphertexts written with a known key;
42
+ - help judge **whether a ciphertext was written with a given key**: text in the key comes out readable, text in another key comes out as nonsense;
43
+ - **rank** the keys in a collection by how well a ciphertext fits them, and say which language each output reads most like.
44
+
45
+ **It cannot**
46
+ - find an **unknown** key. A key, or at least the full table of which symbol means what, must already be known;
47
+ - replace expert review. All outputs are drafts, and the ranking scores have not yet been validated on real collections.
48
+
49
+ **Cipher features that are not supported**
50
+
51
+ The tool handles simple and homophonic substitution, where each cipher symbol stands for exactly one thing (a simple substitution cipher is the special case with one symbol per letter): a letter, a group of letters, a whole word (nomenclature), a word gap, a null, or a "repeat the previous letter" sign. The following are **not** supported:
52
+
53
+ - **Codes written without separators.** A transcription such as `067547700454`, meaning the codes 0675 4770 0454, cannot be split correctly. Transcribe with spaces between codes.
54
+ - **Symbols with several meanings (polyphones).** Each symbol can stand for only one thing.
55
+ - **Context-dependent rules.** Symbols whose meaning depends on their position or on neighbouring symbols.
56
+ - **Cancellation signs.** Symbols that mean "ignore the previous symbol" or "delete the next symbol".
57
+ - **Other cipher types.** Polyalphabetic ciphers (where the key changes during the text), transposition, and codebooks that need more than a symbol-for-unit table.
58
+
59
+ Python users can imitate some of these with custom edits (see the guides).
60
+
61
+ ## Privacy
62
+
63
+ In Colab, files are processed on Google's servers for the length of a session, and are deleted when it ends unless you save them to Google Drive. Nothing is shared unless you choose to share a trained model. For full control, use the [local version](docs/LOCAL_INSTALL.md).
64
+
65
+ ## Repository contents
66
+
67
+ | Folder | Contents |
68
+ |--------|----------|
69
+ | `notebooks/` | The two Colab notebooks (generated by `tools/build_notebooks.py`). |
70
+ | `src/keybridge/` | The Python package used by the notebooks and the command line. |
71
+ | `docs/` | Guides for users, and [setup notes for maintainers](docs/MAINTAINER_SETUP.md). |
72
+ | `examples/` | Example keys (Maximilian II, Copiale) and a synthetic transcription. |
73
+ | `tools/` | Scripts for building the notebooks and the language statistics. |
74
+ | `hf_collection_template/` | Template for the Hugging Face model collection. |
75
+ | `LICENSE`, `LICENSE-CC-BY-4.0.txt`, `CITATION.cff` | Licences and citation information. |
76
+
77
+ ## Licence and citation
78
+
79
+ - **Code** (`src/`, `tools/`, `notebooks/`): [MIT licence](LICENSE).
80
+ - **Models, keys, language profiles and documentation:** [CC BY 4.0](LICENSE-CC-BY-4.0.txt).
81
+
82
+ You may use and adapt all of it for any purpose. If you use the tool, its models or its keys in your work, please cite the publication above. GitHub's "Cite this repository" button gives the reference ([CITATION.cff](CITATION.cff)). When you use a model from the shared collection, please also credit the original source of its key, given in the model's description.
@@ -0,0 +1,63 @@
1
+ # keybridge: neural decipherment of historical simple and homophonic substitution ciphers
2
+
3
+ Archives hold many cipher keys whose ciphertexts have never been identified, and many ciphertexts whose keys are unknown. This tool helps connect the two. For a **known key**, it trains a small neural network on synthetic examples. That network then reads authentic ciphertexts written with the key, and fails visibly on ciphertexts written with other keys.
4
+
5
+ The method and its evaluation are described in: *[citation to be added]* <!-- PLACEHOLDER -->
6
+
7
+ ## Three ways to use it
8
+
9
+ | | What it does | Where it runs |
10
+ |-|--------------|---------------|
11
+ | **① Train a model for your key** | You provide a key and plaintext in the cipher's language; you get a trained model and, optionally, a draft decipherment of your transcription. | [Open in Colab](https://colab.research.google.com/github/mbruton0426/keybridge/blob/main/notebooks/1_train_your_own_model.ipynb) · [Guide](docs/TRAINING_GUIDE.md) |
12
+ | **② Read or scan a ciphertext** | Runs your transcription through one model, or all models in the shared collection. Ranks which keys it fits and which language the result reads like. | [Open in Colab](https://colab.research.google.com/github/mbruton0426/keybridge/blob/main/notebooks/2_read_or_scan_a_ciphertext.ipynb) · [Guide](docs/READING_AND_SCANNING_GUIDE.md) |
13
+ | **Local version** | The same as ① and ② from the command line, entirely on your own computer. It can run fully offline. | [Install and use](docs/LOCAL_INSTALL.md) |
14
+
15
+ The Colab notebooks need only a Google account and a web browser. Nothing has to be installed, and no code has to be written. Keys and transcriptions are simple text files in one standard format (symbols separated by spaces): see **[Key file format](docs/KEY_FORMAT.md)** and **[Transcription format](docs/TRANSCRIPTION_FORMAT.md)**.
16
+
17
+ For research use, `keybridge evaluate` scores a model's reading of an authentic ciphertext against its key (F1 with confidence intervals), as reported in the paper; see [LOCAL_INSTALL.md](docs/LOCAL_INSTALL.md#score-a-reading-against-the-key-research).
18
+
19
+ ## What it can and cannot do
20
+
21
+ **It can**
22
+ - produce **draft decipherments** of transcribed ciphertexts written with a known key;
23
+ - help judge **whether a ciphertext was written with a given key**: text in the key comes out readable, text in another key comes out as nonsense;
24
+ - **rank** the keys in a collection by how well a ciphertext fits them, and say which language each output reads most like.
25
+
26
+ **It cannot**
27
+ - find an **unknown** key. A key, or at least the full table of which symbol means what, must already be known;
28
+ - replace expert review. All outputs are drafts, and the ranking scores have not yet been validated on real collections.
29
+
30
+ **Cipher features that are not supported**
31
+
32
+ The tool handles simple and homophonic substitution, where each cipher symbol stands for exactly one thing (a simple substitution cipher is the special case with one symbol per letter): a letter, a group of letters, a whole word (nomenclature), a word gap, a null, or a "repeat the previous letter" sign. The following are **not** supported:
33
+
34
+ - **Codes written without separators.** A transcription such as `067547700454`, meaning the codes 0675 4770 0454, cannot be split correctly. Transcribe with spaces between codes.
35
+ - **Symbols with several meanings (polyphones).** Each symbol can stand for only one thing.
36
+ - **Context-dependent rules.** Symbols whose meaning depends on their position or on neighbouring symbols.
37
+ - **Cancellation signs.** Symbols that mean "ignore the previous symbol" or "delete the next symbol".
38
+ - **Other cipher types.** Polyalphabetic ciphers (where the key changes during the text), transposition, and codebooks that need more than a symbol-for-unit table.
39
+
40
+ Python users can imitate some of these with custom edits (see the guides).
41
+
42
+ ## Privacy
43
+
44
+ In Colab, files are processed on Google's servers for the length of a session, and are deleted when it ends unless you save them to Google Drive. Nothing is shared unless you choose to share a trained model. For full control, use the [local version](docs/LOCAL_INSTALL.md).
45
+
46
+ ## Repository contents
47
+
48
+ | Folder | Contents |
49
+ |--------|----------|
50
+ | `notebooks/` | The two Colab notebooks (generated by `tools/build_notebooks.py`). |
51
+ | `src/keybridge/` | The Python package used by the notebooks and the command line. |
52
+ | `docs/` | Guides for users, and [setup notes for maintainers](docs/MAINTAINER_SETUP.md). |
53
+ | `examples/` | Example keys (Maximilian II, Copiale) and a synthetic transcription. |
54
+ | `tools/` | Scripts for building the notebooks and the language statistics. |
55
+ | `hf_collection_template/` | Template for the Hugging Face model collection. |
56
+ | `LICENSE`, `LICENSE-CC-BY-4.0.txt`, `CITATION.cff` | Licences and citation information. |
57
+
58
+ ## Licence and citation
59
+
60
+ - **Code** (`src/`, `tools/`, `notebooks/`): [MIT licence](LICENSE).
61
+ - **Models, keys, language profiles and documentation:** [CC BY 4.0](LICENSE-CC-BY-4.0.txt).
62
+
63
+ You may use and adapt all of it for any purpose. If you use the tool, its models or its keys in your work, please cite the publication above. GitHub's "Cite this repository" button gives the reference ([CITATION.cff](CITATION.cff)). When you use a model from the shared collection, please also credit the original source of its key, given in the model's description.
@@ -0,0 +1,34 @@
1
+ [build-system]
2
+ requires = ["setuptools>=64"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "keybridge"
7
+ version = "1.0.0"
8
+ description = "Shared-space neural decipherment of historical simple and homophonic substitution ciphers"
9
+ readme = "README.md"
10
+ license = {text = "MIT"} # code; models, keys, language profiles and docs: CC BY 4.0
11
+ authors = [{name = "Micaella Bruton"}, {name = "Meriem Beloucif"}, {name = "Beáta Megyesi"}]
12
+ requires-python = ">=3.9"
13
+ dependencies = [
14
+ "torch>=2.1",
15
+ "scikit-learn>=1.0",
16
+ "huggingface_hub>=0.20",
17
+ "datasets>=2.14",
18
+ "optuna>=3.0",
19
+ ]
20
+
21
+ [project.optional-dependencies]
22
+ search = [] # kept so older install commands still work; optuna is now always installed
23
+
24
+ [project.scripts]
25
+ keybridge = "keybridge.cli:main"
26
+
27
+ [project.urls]
28
+ Homepage = "https://github.com/mbruton0426/keybridge"
29
+
30
+ [tool.setuptools.packages.find]
31
+ where = ["src"]
32
+
33
+ [tool.setuptools.package-data]
34
+ keybridge = ["language_profiles/*.json.gz"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,6 @@
1
+ """Shared-space decipherment of simple and homophonic substitution ciphers.
2
+
3
+ Train a model for a known key, read transcriptions with it, and test transcriptions
4
+ against a collection of models. See the README for the notebooks and the command line.
5
+ """
6
+ __version__ = "1.0.0"
@@ -0,0 +1,3 @@
1
+ from .cli import main
2
+
3
+ main()