urielplus 1.3__tar.gz → 1.3.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.
Files changed (37) hide show
  1. {urielplus-1.3/urielplus.egg-info → urielplus-1.3.2}/PKG-INFO +21 -4
  2. {urielplus-1.3 → urielplus-1.3.2}/README.md +20 -3
  3. {urielplus-1.3 → urielplus-1.3.2}/THIRD_PARTY_NOTICES.md +1 -1
  4. {urielplus-1.3 → urielplus-1.3.2}/setup.py +1 -1
  5. {urielplus-1.3 → urielplus-1.3.2}/urielplus/urielplus_imputation.py +5 -5
  6. {urielplus-1.3 → urielplus-1.3.2/urielplus.egg-info}/PKG-INFO +21 -4
  7. {urielplus-1.3 → urielplus-1.3.2}/LICENSE.txt +0 -0
  8. {urielplus-1.3 → urielplus-1.3.2}/MANIFEST.in +0 -0
  9. {urielplus-1.3 → urielplus-1.3.2}/pyproject.toml +0 -0
  10. {urielplus-1.3 → urielplus-1.3.2}/setup.cfg +0 -0
  11. {urielplus-1.3 → urielplus-1.3.2}/urielplus/__init__.py +0 -0
  12. {urielplus-1.3 → urielplus-1.3.2}/urielplus/base_uriel.py +0 -0
  13. {urielplus-1.3 → urielplus-1.3.2}/urielplus/database/__init__.py +0 -0
  14. {urielplus-1.3 → urielplus-1.3.2}/urielplus/database/original_uriel/__init__.py +0 -0
  15. {urielplus-1.3 → urielplus-1.3.2}/urielplus/database/original_uriel/family_features.npz +0 -0
  16. {urielplus-1.3 → urielplus-1.3.2}/urielplus/database/original_uriel/features.npz +0 -0
  17. {urielplus-1.3 → urielplus-1.3.2}/urielplus/database/original_uriel/geocoord_features.npz +0 -0
  18. {urielplus-1.3 → urielplus-1.3.2}/urielplus/database/original_uriel/script_features.npz +0 -0
  19. {urielplus-1.3 → urielplus-1.3.2}/urielplus/database/urielplus_csvs/__init__.py +0 -0
  20. {urielplus-1.3 → urielplus-1.3.2}/urielplus/database/urielplus_csvs/apics_data.csv +0 -0
  21. {urielplus-1.3 → urielplus-1.3.2}/urielplus/database/urielplus_csvs/bdproto_data.csv +0 -0
  22. {urielplus-1.3 → urielplus-1.3.2}/urielplus/database/urielplus_csvs/dialects.csv +0 -0
  23. {urielplus-1.3 → urielplus-1.3.2}/urielplus/database/urielplus_csvs/english_dialect_data.csv +0 -0
  24. {urielplus-1.3 → urielplus-1.3.2}/urielplus/database/urielplus_csvs/feature_mappings.json +0 -0
  25. {urielplus-1.3 → urielplus-1.3.2}/urielplus/database/urielplus_csvs/grambank_data.csv +0 -0
  26. {urielplus-1.3 → urielplus-1.3.2}/urielplus/database/urielplus_csvs/lang_fam_geo.csv +0 -0
  27. {urielplus-1.3 → urielplus-1.3.2}/urielplus/database/urielplus_csvs/resource_languages.json +0 -0
  28. {urielplus-1.3 → urielplus-1.3.2}/urielplus/database/urielplus_csvs/saphon_data.csv +0 -0
  29. {urielplus-1.3 → urielplus-1.3.2}/urielplus/database/urielplus_csvs/script_data.csv +0 -0
  30. {urielplus-1.3 → urielplus-1.3.2}/urielplus/database/urielplus_csvs/uriel_glottocode_map.csv +0 -0
  31. {urielplus-1.3 → urielplus-1.3.2}/urielplus/urielplus.py +0 -0
  32. {urielplus-1.3 → urielplus-1.3.2}/urielplus/urielplus_databases.py +1 -1
  33. {urielplus-1.3 → urielplus-1.3.2}/urielplus/urielplus_querying.py +0 -0
  34. {urielplus-1.3 → urielplus-1.3.2}/urielplus.egg-info/SOURCES.txt +0 -0
  35. {urielplus-1.3 → urielplus-1.3.2}/urielplus.egg-info/dependency_links.txt +0 -0
  36. {urielplus-1.3 → urielplus-1.3.2}/urielplus.egg-info/requires.txt +0 -0
  37. {urielplus-1.3 → urielplus-1.3.2}/urielplus.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: urielplus
3
- Version: 1.3
3
+ Version: 1.3.2
4
4
  Summary: URIEL+: Knowledge base for natural language processing
5
5
  Home-page: https://github.com/Masonshipton25/URIELPlus
6
6
  Author: Mason Shipton
@@ -256,26 +256,43 @@ The core package is tested on Python 3.10, 3.11, and 3.12. It does not require T
256
256
 
257
257
  ## Database Integration Examples
258
258
 
259
+ + NOTE: `integrate_databases()` integrates **all** available databases, including eWAVE and APiCS, which you may not want. eWAVE adds hundreds of features that only apply to English dialects, and APiCS adds hundreds of features but has data for only 76 languages. Both can add substantial sparsity and features you may not need. To exclude them, integrate only the databases you want, either individually or in one call (see "Integrating Only Some Databases" below).
260
+
261
+ + Integrating All Databases:
262
+ ```python
263
+ u.integrate_databases()
264
+ ```
259
265
  + Integrating One Database:
260
266
  ```python
261
267
  u.integrate_{database}()
262
268
  ```
263
- + Integrating Some Databases:
269
+ + Integrating Only Some Databases (Excluding Others):
264
270
  ```python
265
271
  u.integrate_custom_databases({databases})
266
272
  ```
267
- + Integrating All Databases:
273
+
274
+ + Example: Integrating Every Database Except eWAVE and APiCS
268
275
  ```python
269
- u.integrate_databases()
276
+ # Option 1: one call
277
+ u.integrate_custom_databases("UPDATED_SAPHON", "BDPROTO", "GRAMBANK", "GLOTTOLOG")
278
+
279
+ # Option 2: one database at a time
280
+ u.integrate_saphon()
281
+ u.integrate_bdproto()
282
+ u.integrate_grambank()
283
+ u.integrate_glottolog()
270
284
  ```
285
+
271
286
  + Set Language Codes to Glottocodes:
272
287
  ```python
273
288
  u.set_glottocodes()
274
289
  ```
290
+
275
291
  + Reset all changes:
276
292
  ```python
277
293
  u.reset()
278
294
  ```
295
+
279
296
  + NOTE: `reset()` only resets URIEL+'s in-memory attributes back to their initial state. It does not change or delete any files that were already written to disk when caching was enabled. If you want those cached files reset as well, you will need to remove or replace them manually.
280
297
 
281
298
  + Replace `{database}` with `saphon`, `bdproto`, `grambank`, `apics`, `ewave`, or `glottolog`.
@@ -208,26 +208,43 @@ The core package is tested on Python 3.10, 3.11, and 3.12. It does not require T
208
208
 
209
209
  ## Database Integration Examples
210
210
 
211
+ + NOTE: `integrate_databases()` integrates **all** available databases, including eWAVE and APiCS, which you may not want. eWAVE adds hundreds of features that only apply to English dialects, and APiCS adds hundreds of features but has data for only 76 languages. Both can add substantial sparsity and features you may not need. To exclude them, integrate only the databases you want, either individually or in one call (see "Integrating Only Some Databases" below).
212
+
213
+ + Integrating All Databases:
214
+ ```python
215
+ u.integrate_databases()
216
+ ```
211
217
  + Integrating One Database:
212
218
  ```python
213
219
  u.integrate_{database}()
214
220
  ```
215
- + Integrating Some Databases:
221
+ + Integrating Only Some Databases (Excluding Others):
216
222
  ```python
217
223
  u.integrate_custom_databases({databases})
218
224
  ```
219
- + Integrating All Databases:
225
+
226
+ + Example: Integrating Every Database Except eWAVE and APiCS
220
227
  ```python
221
- u.integrate_databases()
228
+ # Option 1: one call
229
+ u.integrate_custom_databases("UPDATED_SAPHON", "BDPROTO", "GRAMBANK", "GLOTTOLOG")
230
+
231
+ # Option 2: one database at a time
232
+ u.integrate_saphon()
233
+ u.integrate_bdproto()
234
+ u.integrate_grambank()
235
+ u.integrate_glottolog()
222
236
  ```
237
+
223
238
  + Set Language Codes to Glottocodes:
224
239
  ```python
225
240
  u.set_glottocodes()
226
241
  ```
242
+
227
243
  + Reset all changes:
228
244
  ```python
229
245
  u.reset()
230
246
  ```
247
+
231
248
  + NOTE: `reset()` only resets URIEL+'s in-memory attributes back to their initial state. It does not change or delete any files that were already written to disk when caching was enabled. If you want those cached files reset as well, you will need to remove or replace them manually.
232
249
 
233
250
  + Replace `{database}` with `saphon`, `bdproto`, `grambank`, `apics`, `ewave`, or `glottolog`.
@@ -1,6 +1,6 @@
1
1
  # Third-party notices
2
2
 
3
- URIELPlus v1.3 is distributed under the Creative Commons Attribution-ShareAlike 4.0 International licence in `LICENSE.txt`. The source tables incorporated into the released database retain the separate licences stated below. The licences for those source tables are not replaced by the URIELPlus licence.
3
+ URIELPlus v1.3.2 is distributed under the Creative Commons Attribution-ShareAlike 4.0 International licence in `LICENSE.txt`. The source tables incorporated into the released database retain the separate licences stated below. The licences for those source tables are not replaced by the URIELPlus licence.
4
4
 
5
5
  | Source material | Locked version | Files containing derived values | Attribution | Source licence | Primary licence record |
6
6
  | --- | --- | --- | --- | --- | --- |
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setup(
7
7
  name="urielplus",
8
- version="1.3",
8
+ version="1.3.2",
9
9
  author="Mason Shipton",
10
10
  author_email="masonshipton25@gmail.com",
11
11
  description="URIEL+: Knowledge base for natural language processing",
@@ -165,14 +165,14 @@ class URIELPlusImputation(BaseURIEL):
165
165
  child_idx = glottocode_to_idx.get(child_glottocode)
166
166
  if child_idx is not None and child_idx not in visited:
167
167
  child_features = aggregated_data[child_idx]
168
- before = child_features.copy()
169
168
 
170
169
  fill_mask = (child_features == -1.0) & (parent_features > -1.0)
171
- updated_child_features = np.where(fill_mask, parent_features, child_features)
172
170
 
173
- changed_feats = np.where(updated_child_features != before)[0]
174
- for feat_idx in changed_feats:
175
- self.lineage_imputed_indices.add((child_idx, feat_idx))
171
+ if fill_mask.any():
172
+ aggregated_data[child_idx] = np.where(fill_mask, parent_features, child_features)
173
+
174
+ for feat_idx in np.where(fill_mask)[0]:
175
+ self.lineage_imputed_indices.add((child_idx, int(feat_idx)))
176
176
 
177
177
  visited.add(child_idx)
178
178
  queue.append(child_idx)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: urielplus
3
- Version: 1.3
3
+ Version: 1.3.2
4
4
  Summary: URIEL+: Knowledge base for natural language processing
5
5
  Home-page: https://github.com/Masonshipton25/URIELPlus
6
6
  Author: Mason Shipton
@@ -256,26 +256,43 @@ The core package is tested on Python 3.10, 3.11, and 3.12. It does not require T
256
256
 
257
257
  ## Database Integration Examples
258
258
 
259
+ + NOTE: `integrate_databases()` integrates **all** available databases, including eWAVE and APiCS, which you may not want. eWAVE adds hundreds of features that only apply to English dialects, and APiCS adds hundreds of features but has data for only 76 languages. Both can add substantial sparsity and features you may not need. To exclude them, integrate only the databases you want, either individually or in one call (see "Integrating Only Some Databases" below).
260
+
261
+ + Integrating All Databases:
262
+ ```python
263
+ u.integrate_databases()
264
+ ```
259
265
  + Integrating One Database:
260
266
  ```python
261
267
  u.integrate_{database}()
262
268
  ```
263
- + Integrating Some Databases:
269
+ + Integrating Only Some Databases (Excluding Others):
264
270
  ```python
265
271
  u.integrate_custom_databases({databases})
266
272
  ```
267
- + Integrating All Databases:
273
+
274
+ + Example: Integrating Every Database Except eWAVE and APiCS
268
275
  ```python
269
- u.integrate_databases()
276
+ # Option 1: one call
277
+ u.integrate_custom_databases("UPDATED_SAPHON", "BDPROTO", "GRAMBANK", "GLOTTOLOG")
278
+
279
+ # Option 2: one database at a time
280
+ u.integrate_saphon()
281
+ u.integrate_bdproto()
282
+ u.integrate_grambank()
283
+ u.integrate_glottolog()
270
284
  ```
285
+
271
286
  + Set Language Codes to Glottocodes:
272
287
  ```python
273
288
  u.set_glottocodes()
274
289
  ```
290
+
275
291
  + Reset all changes:
276
292
  ```python
277
293
  u.reset()
278
294
  ```
295
+
279
296
  + NOTE: `reset()` only resets URIEL+'s in-memory attributes back to their initial state. It does not change or delete any files that were already written to disk when caching was enabled. If you want those cached files reset as well, you will need to remove or replace them manually.
280
297
 
281
298
  + Replace `{database}` with `saphon`, `bdproto`, `grambank`, `apics`, `ewave`, or `glottolog`.
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -154,10 +154,10 @@ class URIELPlusDatabases(BaseURIEL):
154
154
  for row, language in enumerate(languages):
155
155
  if language not in selected.index:
156
156
  continue
157
+ data[row, :, 0] = 0
157
158
  parts = self._lineage_parts(selected.at[language, "lineage"])
158
159
  if not parts:
159
160
  continue
160
- data[row, :, 0] = 0
161
161
  indices = [path_index[parts[:depth]] for depth in range(1, len(parts) + 1)]
162
162
  data[row, indices, 0] = 1
163
163