Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
552fa2daaf | ||
|
|
0b19f6c6af | ||
|
|
cf10f84606 | ||
|
|
49afc6e9a3 | ||
|
|
fb65a98087 | ||
|
|
9fa01ad366 | ||
|
|
3abb33d05b | ||
|
|
be5e4a9da0 | ||
|
|
4626737e08 | ||
|
|
8f475488d5 | ||
|
|
0acf17197d | ||
|
|
82a13c9da3 | ||
|
|
c5dd482116 | ||
|
|
2d23c4d05b | ||
|
|
375ae720d9 | ||
|
|
e7ad579b02 | ||
|
|
2ab5086057 | ||
|
|
fbdad69a1d | ||
|
|
339f12d553 | ||
|
|
cefc8c1b85 | ||
|
|
6794dde27e | ||
|
|
9e4a1c3c69 | ||
|
|
ba834f8596 | ||
|
|
9edb02799c | ||
|
|
05c20a34f7 | ||
|
|
45db15b22b | ||
|
|
1b4d0e053d | ||
|
|
1fe273c747 | ||
|
|
a2a4798ba7 | ||
|
|
4280ac24b8 | ||
|
|
23de1204f8 | ||
|
|
60198c2225 | ||
|
|
e42c81e32a | ||
|
|
ddd5e4e891 | ||
|
|
5d10af42f0 | ||
|
|
e25b5ed41b | ||
|
|
c04f462b08 | ||
|
|
7e79e8ed16 | ||
|
|
2ca33edaa4 | ||
|
|
a5ae3a4605 | ||
|
|
ad1e789e8e | ||
|
|
32d1e27fc5 | ||
|
|
987ae4ad1a | ||
|
|
d41e3b1e6a | ||
|
|
463c348007 | ||
|
|
2f90d8f16a | ||
|
|
1f2636b95d | ||
|
|
e101e6e8a7 | ||
|
|
886c941f7f | ||
|
|
53da57288a |
@@ -0,0 +1 @@
|
||||
.venv
|
||||
@@ -0,0 +1,34 @@
|
||||
# Datenqualitäts-Analysen (openalex-authors)
|
||||
|
||||
## Verwendung
|
||||
|
||||
```bash
|
||||
cd analysis/data
|
||||
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
|
||||
python authors.py --help
|
||||
```
|
||||
|
||||
Beispiele:
|
||||
|
||||
```bash
|
||||
# alle Analysen
|
||||
python authors.py
|
||||
|
||||
# nur eine Analyse
|
||||
python authors.py --analysis 8
|
||||
|
||||
# auf eine Institution eingegrenzt (hier: UDE) und Ergebnis speichern (txt)
|
||||
python authors.py --analysis 8 --filter-uni I62318514 --save
|
||||
```
|
||||
|
||||
## Parameter
|
||||
|
||||
| Parameter | Wert | Bedeutung |
|
||||
| ----------------- | ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `--analysis N` | `1`–`8` | Führt nur diese eine Analyse aus. Ohne Angabe laufen **alle acht** nacheinander. |
|
||||
| `--filter-uni ID` | OpenAlex-Institutions-ID, z. B. `I62318514` | Schränkt jede Suche auf Autor:innen dieser Institution ein. Filtert über `affiliations.institution.lineage`, **inklusive Unter-Einheiten** (Institute, Fakultäten). Das Präfix `https://openalex.org/` wird bei Bedarf ergänzt, `I62318514` und die volle URL funktionieren beide. Ohne Angabe wird der gesamte Index durchsucht. |
|
||||
| `--save` | Flag | Schreibt die Ausgabe zusätzlich nach `analysen/run_<timestamp>.txt` (also in diesen Ordner). Der Pfad hängt am Skript-Verzeichnis, nicht am aktuellen Arbeitsverzeichnis — der Aufruf funktioniert also aus jedem `cwd`. Ohne das Flag geht die Ausgabe nur nach stdout. |
|
||||
@@ -0,0 +1,503 @@
|
||||
Analyse 1: ORCIDs, die von 2 oder mehr Autoren-Dokumenten geteilt werden.
|
||||
ORCID | Anzahl Autoren
|
||||
------------------------------------- | --------------
|
||||
https://orcid.org/0000-0002-1652-6686 | 37
|
||||
https://orcid.org/0000-0002-3394-1507 | 35
|
||||
https://orcid.org/0000-0001-9708-5765 | 34
|
||||
https://orcid.org/0000-0002-3156-3741 | 31
|
||||
https://orcid.org/0000-0001-8829-9817 | 30
|
||||
https://orcid.org/0000-0003-3256-740X | 28
|
||||
https://orcid.org/0000-0003-3875-3561 | 28
|
||||
https://orcid.org/0009-0006-5046-8527 | 28
|
||||
https://orcid.org/0000-0003-1006-7594 | 27
|
||||
https://orcid.org/0000-0002-0439-1390 | 23
|
||||
https://orcid.org/0000-0003-3112-4252 | 23
|
||||
https://orcid.org/0000-0001-8601-2325 | 22
|
||||
https://orcid.org/0000-0002-1276-5858 | 22
|
||||
https://orcid.org/0000-0001-8418-5054 | 21
|
||||
https://orcid.org/0000-0002-0482-2111 | 20
|
||||
https://orcid.org/0000-0002-5163-0489 | 20
|
||||
https://orcid.org/0000-0003-4433-5227 | 19
|
||||
https://orcid.org/0009-0009-5669-1676 | 18
|
||||
https://orcid.org/0000-0002-6157-2016 | 17
|
||||
https://orcid.org/0000-0002-0991-5026 | 16
|
||||
https://orcid.org/0000-0002-3128-9025 | 16
|
||||
https://orcid.org/0000-0001-9286-2123 | 15
|
||||
https://orcid.org/0000-0002-0374-7404 | 15
|
||||
https://orcid.org/0000-0002-3440-2767 | 15
|
||||
https://orcid.org/0000-0002-9627-5433 | 15
|
||||
https://orcid.org/0000-0003-3703-6624 | 15
|
||||
https://orcid.org/0000-0001-5720-6649 | 14
|
||||
https://orcid.org/0000-0001-9725-2316 | 14
|
||||
https://orcid.org/0000-0002-5530-0380 | 14
|
||||
https://orcid.org/0000-0002-9099-6870 | 14
|
||||
https://orcid.org/0000-0003-4067-1127 | 14
|
||||
https://orcid.org/0000-0001-5472-562X | 13
|
||||
https://orcid.org/0000-0001-5818-1682 | 13
|
||||
https://orcid.org/0000-0001-7575-3603 | 13
|
||||
https://orcid.org/0000-0001-9532-5075 | 13
|
||||
https://orcid.org/0000-0002-2413-3858 | 13
|
||||
https://orcid.org/0000-0003-0910-4095 | 13
|
||||
https://orcid.org/0000-0003-1983-3435 | 13
|
||||
https://orcid.org/0000-0001-6463-7869 | 12
|
||||
https://orcid.org/0000-0002-4424-8345 | 12
|
||||
https://orcid.org/0000-0002-6170-4744 | 12
|
||||
https://orcid.org/0000-0002-7836-1100 | 12
|
||||
https://orcid.org/0000-0002-8407-0369 | 12
|
||||
https://orcid.org/0000-0003-0524-1914 | 12
|
||||
https://orcid.org/0009-0002-6108-5477 | 12
|
||||
https://orcid.org/0009-0004-1348-0805 | 12
|
||||
https://orcid.org/0009-0004-8479-2072 | 12
|
||||
https://orcid.org/0009-0008-7694-4987 | 12
|
||||
https://orcid.org/0000-0001-5286-4423 | 11
|
||||
https://orcid.org/0000-0001-6470-4662 | 11
|
||||
https://orcid.org/0000-0001-9234-019X | 11
|
||||
https://orcid.org/0000-0002-4332-3518 | 11
|
||||
https://orcid.org/0000-0002-5806-6403 | 11
|
||||
https://orcid.org/0000-0002-5839-0895 | 11
|
||||
https://orcid.org/0000-0002-6053-902X | 11
|
||||
https://orcid.org/0000-0002-6432-7542 | 11
|
||||
https://orcid.org/0000-0002-8771-3120 | 11
|
||||
https://orcid.org/0000-0003-3966-3111 | 11
|
||||
https://orcid.org/0009-0002-5212-4710 | 11
|
||||
https://orcid.org/0009-0009-8910-1396 | 11
|
||||
https://orcid.org/0000-0001-5866-1504 | 10
|
||||
https://orcid.org/0000-0001-6623-1205 | 10
|
||||
https://orcid.org/0000-0001-6717-0803 | 10
|
||||
https://orcid.org/0000-0001-6825-5956 | 10
|
||||
https://orcid.org/0000-0001-7954-1149 | 10
|
||||
https://orcid.org/0000-0001-8075-2867 | 10
|
||||
https://orcid.org/0000-0001-9061-4281 | 10
|
||||
https://orcid.org/0000-0002-0124-9065 | 10
|
||||
https://orcid.org/0000-0002-1153-816X | 10
|
||||
https://orcid.org/0000-0002-1528-4865 | 10
|
||||
https://orcid.org/0000-0002-2283-1863 | 10
|
||||
https://orcid.org/0000-0002-3236-6766 | 10
|
||||
https://orcid.org/0000-0002-3789-0081 | 10
|
||||
https://orcid.org/0000-0002-5076-7803 | 10
|
||||
https://orcid.org/0000-0002-6925-5189 | 10
|
||||
https://orcid.org/0000-0003-0056-7296 | 10
|
||||
https://orcid.org/0000-0003-1685-7968 | 10
|
||||
https://orcid.org/0000-0003-1785-3491 | 10
|
||||
https://orcid.org/0000-0003-2076-1133 | 10
|
||||
https://orcid.org/0000-0003-2098-3844 | 10
|
||||
https://orcid.org/0000-0003-4632-0213 | 10
|
||||
https://orcid.org/0009-0006-5916-3682 | 10
|
||||
https://orcid.org/0000-0001-5728-871X | 9
|
||||
https://orcid.org/0000-0001-8551-7866 | 9
|
||||
https://orcid.org/0000-0001-9384-6598 | 9
|
||||
https://orcid.org/0000-0001-9548-0358 | 9
|
||||
https://orcid.org/0000-0001-9853-6257 | 9
|
||||
https://orcid.org/0000-0002-0374-1838 | 9
|
||||
https://orcid.org/0000-0002-1122-0055 | 9
|
||||
https://orcid.org/0000-0002-1157-1859 | 9
|
||||
https://orcid.org/0000-0002-3633-7065 | 9
|
||||
https://orcid.org/0000-0002-3864-9257 | 9
|
||||
https://orcid.org/0000-0002-4817-7775 | 9
|
||||
https://orcid.org/0000-0002-6374-458X | 9
|
||||
https://orcid.org/0000-0002-6758-0113 | 9
|
||||
https://orcid.org/0000-0002-6764-4789 | 9
|
||||
https://orcid.org/0000-0002-9763-9155 | 9
|
||||
https://orcid.org/0000-0003-1112-8336 | 9
|
||||
https://orcid.org/0000-0003-4667-3502 | 9
|
||||
https://orcid.org/0009-0000-8033-8498 | 9
|
||||
https://orcid.org/0009-0001-0761-7543 | 9
|
||||
https://orcid.org/0009-0001-4259-5917 | 9
|
||||
https://orcid.org/0009-0002-3680-1224 | 9
|
||||
https://orcid.org/0009-0002-8176-3757 | 9
|
||||
https://orcid.org/0009-0002-8563-7248 | 9
|
||||
https://orcid.org/0009-0006-3511-9329 | 9
|
||||
https://orcid.org/0009-0007-2108-5110 | 9
|
||||
https://orcid.org/0009-0008-8730-8097 | 9
|
||||
https://orcid.org/0009-0009-8845-6742 | 9
|
||||
https://orcid.org/0000-0001-5233-3139 | 8
|
||||
https://orcid.org/0000-0001-5252-0831 | 8
|
||||
https://orcid.org/0000-0001-5775-7993 | 8
|
||||
https://orcid.org/0000-0001-6072-3874 | 8
|
||||
https://orcid.org/0000-0001-6819-6562 | 8
|
||||
https://orcid.org/0000-0001-6923-7936 | 8
|
||||
https://orcid.org/0000-0002-0584-8700 | 8
|
||||
https://orcid.org/0000-0002-1129-2083 | 8
|
||||
https://orcid.org/0000-0002-1959-2363 | 8
|
||||
https://orcid.org/0000-0002-2079-996X | 8
|
||||
https://orcid.org/0000-0002-2106-4041 | 8
|
||||
https://orcid.org/0000-0002-2745-5908 | 8
|
||||
https://orcid.org/0000-0002-3225-2769 | 8
|
||||
https://orcid.org/0000-0002-3365-3927 | 8
|
||||
https://orcid.org/0000-0002-3397-3496 | 8
|
||||
https://orcid.org/0000-0002-3650-4548 | 8
|
||||
https://orcid.org/0000-0002-3934-6004 | 8
|
||||
https://orcid.org/0000-0002-4006-7029 | 8
|
||||
https://orcid.org/0000-0002-4485-6017 | 8
|
||||
https://orcid.org/0000-0002-4974-7004 | 8
|
||||
https://orcid.org/0000-0002-5105-1305 | 8
|
||||
https://orcid.org/0000-0002-5380-9829 | 8
|
||||
https://orcid.org/0000-0002-6047-4211 | 8
|
||||
https://orcid.org/0000-0002-6999-3931 | 8
|
||||
https://orcid.org/0000-0002-7007-9020 | 8
|
||||
https://orcid.org/0000-0002-9808-5035 | 8
|
||||
https://orcid.org/0000-0003-0660-596X | 8
|
||||
https://orcid.org/0000-0003-0664-1653 | 8
|
||||
https://orcid.org/0000-0003-0766-6174 | 8
|
||||
https://orcid.org/0000-0003-1925-4337 | 8
|
||||
https://orcid.org/0000-0003-2320-7621 | 8
|
||||
https://orcid.org/0000-0003-2611-1975 | 8
|
||||
https://orcid.org/0000-0003-2623-3198 | 8
|
||||
https://orcid.org/0000-0003-3223-1797 | 8
|
||||
https://orcid.org/0000-0003-3303-7769 | 8
|
||||
https://orcid.org/0000-0003-4556-7302 | 8
|
||||
https://orcid.org/0000-0003-4813-8167 | 8
|
||||
https://orcid.org/0009-0000-3081-2665 | 8
|
||||
https://orcid.org/0009-0000-4054-8239 | 8
|
||||
https://orcid.org/0009-0001-1173-3651 | 8
|
||||
https://orcid.org/0009-0002-4054-6799 | 8
|
||||
https://orcid.org/0009-0004-1393-6577 | 8
|
||||
https://orcid.org/0009-0004-2581-9917 | 8
|
||||
https://orcid.org/0009-0005-7271-2677 | 8
|
||||
https://orcid.org/0009-0006-1867-9674 | 8
|
||||
https://orcid.org/0009-0007-7218-9227 | 8
|
||||
https://orcid.org/0009-0008-2045-2609 | 8
|
||||
https://orcid.org/0009-0008-2532-8674 | 8
|
||||
https://orcid.org/0009-0009-0129-3267 | 8
|
||||
https://orcid.org/0000-0001-2345-6789 | 7
|
||||
https://orcid.org/0000-0001-5189-230X | 7
|
||||
https://orcid.org/0000-0001-5501-554X | 7
|
||||
https://orcid.org/0000-0001-5987-3189 | 7
|
||||
https://orcid.org/0000-0001-6057-9243 | 7
|
||||
https://orcid.org/0000-0001-6105-5345 | 7
|
||||
https://orcid.org/0000-0001-6436-7547 | 7
|
||||
https://orcid.org/0000-0001-6533-6144 | 7
|
||||
https://orcid.org/0000-0001-6850-7666 | 7
|
||||
https://orcid.org/0000-0001-6883-3752 | 7
|
||||
https://orcid.org/0000-0001-7483-2991 | 7
|
||||
https://orcid.org/0000-0001-7515-3907 | 7
|
||||
https://orcid.org/0000-0001-7945-2867 | 7
|
||||
https://orcid.org/0000-0001-8191-0046 | 7
|
||||
https://orcid.org/0000-0001-8555-5408 | 7
|
||||
https://orcid.org/0000-0001-9190-4547 | 7
|
||||
https://orcid.org/0000-0001-9539-2155 | 7
|
||||
https://orcid.org/0000-0001-9663-4443 | 7
|
||||
https://orcid.org/0000-0002-0117-7831 | 7
|
||||
https://orcid.org/0000-0002-0207-2871 | 7
|
||||
https://orcid.org/0000-0002-0394-5646 | 7
|
||||
https://orcid.org/0000-0002-0869-5631 | 7
|
||||
https://orcid.org/0000-0002-1051-3833 | 7
|
||||
https://orcid.org/0000-0002-1122-2990 | 7
|
||||
https://orcid.org/0000-0002-1695-9481 | 7
|
||||
https://orcid.org/0000-0002-1933-5383 | 7
|
||||
https://orcid.org/0000-0002-2023-2082 | 7
|
||||
https://orcid.org/0000-0002-2115-9382 | 7
|
||||
https://orcid.org/0000-0002-2138-4395 | 7
|
||||
https://orcid.org/0000-0002-2405-915X | 7
|
||||
https://orcid.org/0000-0002-2593-5297 | 7
|
||||
https://orcid.org/0000-0002-2629-4735 | 7
|
||||
https://orcid.org/0000-0002-2699-2189 | 7
|
||||
https://orcid.org/0000-0002-2782-9519 | 7
|
||||
https://orcid.org/0000-0002-3135-5010 | 7
|
||||
https://orcid.org/0000-0002-3348-1221 | 7
|
||||
https://orcid.org/0000-0002-3725-4800 | 7
|
||||
https://orcid.org/0000-0002-4133-5099 | 7
|
||||
https://orcid.org/0000-0002-4242-2450 | 7
|
||||
https://orcid.org/0000-0002-4526-2149 | 7
|
||||
https://orcid.org/0000-0002-4996-1924 | 7
|
||||
https://orcid.org/0000-0002-5540-3750 | 7
|
||||
https://orcid.org/0000-0002-5956-6258 | 7
|
||||
https://orcid.org/0000-0002-6519-4681 | 7
|
||||
https://orcid.org/0000-0002-7602-2527 | 7
|
||||
https://orcid.org/0000-0002-8002-9086 | 7
|
||||
https://orcid.org/0000-0002-8482-1046 | 7
|
||||
https://orcid.org/0000-0002-8640-4350 | 7
|
||||
https://orcid.org/0000-0002-9192-8757 | 7
|
||||
https://orcid.org/0000-0002-9241-3114 | 7
|
||||
https://orcid.org/0000-0002-9581-2778 | 7
|
||||
https://orcid.org/0000-0002-9749-5550 | 7
|
||||
https://orcid.org/0000-0002-9878-6077 | 7
|
||||
https://orcid.org/0000-0003-0195-7456 | 7
|
||||
https://orcid.org/0000-0003-0266-0224 | 7
|
||||
https://orcid.org/0000-0003-0362-8795 | 7
|
||||
https://orcid.org/0000-0003-0383-6930 | 7
|
||||
https://orcid.org/0000-0003-0609-627X | 7
|
||||
https://orcid.org/0000-0003-1287-1471 | 7
|
||||
https://orcid.org/0000-0003-1430-9191 | 7
|
||||
https://orcid.org/0000-0003-1731-7939 | 7
|
||||
https://orcid.org/0000-0003-2298-0102 | 7
|
||||
https://orcid.org/0000-0003-2323-7521 | 7
|
||||
https://orcid.org/0000-0003-2707-2533 | 7
|
||||
https://orcid.org/0000-0003-2868-7177 | 7
|
||||
https://orcid.org/0000-0003-2973-1803 | 7
|
||||
https://orcid.org/0000-0003-3609-4777 | 7
|
||||
https://orcid.org/0000-0003-3895-9092 | 7
|
||||
https://orcid.org/0000-0003-4316-9642 | 7
|
||||
https://orcid.org/0000-0003-4950-5184 | 7
|
||||
https://orcid.org/0009-0000-7239-3374 | 7
|
||||
https://orcid.org/0009-0000-8636-0848 | 7
|
||||
https://orcid.org/0009-0001-7282-8881 | 7
|
||||
https://orcid.org/0009-0002-0885-5145 | 7
|
||||
https://orcid.org/0009-0002-1063-5117 | 7
|
||||
https://orcid.org/0009-0002-3352-6765 | 7
|
||||
https://orcid.org/0009-0002-4224-5527 | 7
|
||||
https://orcid.org/0009-0002-9160-3095 | 7
|
||||
https://orcid.org/0009-0002-9671-101X | 7
|
||||
https://orcid.org/0009-0003-4314-9534 | 7
|
||||
https://orcid.org/0009-0004-6991-0595 | 7
|
||||
https://orcid.org/0009-0005-5603-6306 | 7
|
||||
https://orcid.org/0009-0005-8813-8745 | 7
|
||||
https://orcid.org/0009-0006-9312-0272 | 7
|
||||
https://orcid.org/0009-0007-1509-2728 | 7
|
||||
https://orcid.org/0009-0007-6670-9679 | 7
|
||||
https://orcid.org/0009-0008-0310-0257 | 7
|
||||
https://orcid.org/0009-0009-4592-6687 | 7
|
||||
https://orcid.org/0009-0009-8645-6685 | 7
|
||||
https://orcid.org/0000-0001-5001-672X | 6
|
||||
https://orcid.org/0000-0001-5637-2653 | 6
|
||||
https://orcid.org/0000-0001-5769-5761 | 6
|
||||
https://orcid.org/0000-0001-5854-7699 | 6
|
||||
https://orcid.org/0000-0001-5967-8674 | 6
|
||||
https://orcid.org/0000-0001-6805-0395 | 6
|
||||
https://orcid.org/0000-0001-6996-4834 | 6
|
||||
https://orcid.org/0000-0001-7179-7043 | 6
|
||||
https://orcid.org/0000-0001-7241-2117 | 6
|
||||
https://orcid.org/0000-0001-7833-4711 | 6
|
||||
https://orcid.org/0000-0001-7842-9518 | 6
|
||||
https://orcid.org/0000-0001-7941-4879 | 6
|
||||
https://orcid.org/0000-0001-8178-2494 | 6
|
||||
https://orcid.org/0000-0001-8375-0760 | 6
|
||||
https://orcid.org/0000-0001-8473-4332 | 6
|
||||
https://orcid.org/0000-0001-8569-8409 | 6
|
||||
https://orcid.org/0000-0001-8673-3026 | 6
|
||||
https://orcid.org/0000-0001-8915-3377 | 6
|
||||
https://orcid.org/0000-0001-9025-2225 | 6
|
||||
https://orcid.org/0000-0001-9086-6091 | 6
|
||||
https://orcid.org/0000-0001-9140-9028 | 6
|
||||
https://orcid.org/0000-0001-9234-4465 | 6
|
||||
https://orcid.org/0000-0001-9416-1742 | 6
|
||||
https://orcid.org/0000-0001-9422-1725 | 6
|
||||
https://orcid.org/0000-0001-9473-8935 | 6
|
||||
https://orcid.org/0000-0001-9524-8452 | 6
|
||||
https://orcid.org/0000-0001-9630-2000 | 6
|
||||
https://orcid.org/0000-0001-9734-3162 | 6
|
||||
https://orcid.org/0000-0001-9861-8922 | 6
|
||||
https://orcid.org/0000-0002-0032-4473 | 6
|
||||
https://orcid.org/0000-0002-0034-6576 | 6
|
||||
https://orcid.org/0000-0002-0038-5372 | 6
|
||||
https://orcid.org/0000-0002-0144-6536 | 6
|
||||
https://orcid.org/0000-0002-0264-7217 | 6
|
||||
https://orcid.org/0000-0002-0531-2148 | 6
|
||||
https://orcid.org/0000-0002-0538-8230 | 6
|
||||
https://orcid.org/0000-0002-0595-0297 | 6
|
||||
https://orcid.org/0000-0002-0657-1766 | 6
|
||||
https://orcid.org/0000-0002-0661-5220 | 6
|
||||
https://orcid.org/0000-0002-0664-9199 | 6
|
||||
https://orcid.org/0000-0002-0682-4313 | 6
|
||||
https://orcid.org/0000-0002-0786-7307 | 6
|
||||
https://orcid.org/0000-0002-0798-9806 | 6
|
||||
https://orcid.org/0000-0002-0857-6317 | 6
|
||||
https://orcid.org/0000-0002-1115-4721 | 6
|
||||
https://orcid.org/0000-0002-1231-5136 | 6
|
||||
https://orcid.org/0000-0002-1640-9180 | 6
|
||||
https://orcid.org/0000-0002-2133-9287 | 6
|
||||
https://orcid.org/0000-0002-2140-4309 | 6
|
||||
https://orcid.org/0000-0002-2141-9543 | 6
|
||||
https://orcid.org/0000-0002-2204-5731 | 6
|
||||
https://orcid.org/0000-0002-2495-0524 | 6
|
||||
https://orcid.org/0000-0002-2629-5420 | 6
|
||||
https://orcid.org/0000-0002-2745-7065 | 6
|
||||
https://orcid.org/0000-0002-2896-3867 | 6
|
||||
https://orcid.org/0000-0002-3122-7617 | 6
|
||||
https://orcid.org/0000-0002-3728-2377 | 6
|
||||
https://orcid.org/0000-0002-3812-4944 | 6
|
||||
https://orcid.org/0000-0002-3820-9366 | 6
|
||||
https://orcid.org/0000-0002-3871-0978 | 6
|
||||
https://orcid.org/0000-0002-4125-8898 | 6
|
||||
https://orcid.org/0000-0002-4620-4223 | 6
|
||||
https://orcid.org/0000-0002-4624-2019 | 6
|
||||
https://orcid.org/0000-0002-4743-8718 | 6
|
||||
https://orcid.org/0000-0002-4841-3600 | 6
|
||||
https://orcid.org/0000-0002-4902-5589 | 6
|
||||
https://orcid.org/0000-0002-5005-3042 | 6
|
||||
https://orcid.org/0000-0002-5278-1430 | 6
|
||||
https://orcid.org/0000-0002-5414-8276 | 6
|
||||
https://orcid.org/0000-0002-5661-4330 | 6
|
||||
https://orcid.org/0000-0002-5728-9867 | 6
|
||||
https://orcid.org/0000-0002-5735-4059 | 6
|
||||
https://orcid.org/0000-0002-5736-1398 | 6
|
||||
https://orcid.org/0000-0002-5865-183X | 6
|
||||
https://orcid.org/0000-0002-5890-0445 | 6
|
||||
https://orcid.org/0000-0002-6083-2656 | 6
|
||||
https://orcid.org/0000-0002-6330-0639 | 6
|
||||
https://orcid.org/0000-0002-6469-8415 | 6
|
||||
https://orcid.org/0000-0002-6513-2309 | 6
|
||||
https://orcid.org/0000-0002-6781-416X | 6
|
||||
https://orcid.org/0000-0002-6785-9202 | 6
|
||||
https://orcid.org/0000-0002-6797-7209 | 6
|
||||
https://orcid.org/0000-0002-6941-8478 | 6
|
||||
https://orcid.org/0000-0002-7093-2677 | 6
|
||||
https://orcid.org/0000-0002-7225-8823 | 6
|
||||
https://orcid.org/0000-0002-7447-5602 | 6
|
||||
https://orcid.org/0000-0002-7543-1628 | 6
|
||||
https://orcid.org/0000-0002-7581-846X | 6
|
||||
https://orcid.org/0000-0002-7929-5889 | 6
|
||||
https://orcid.org/0000-0002-7989-6406 | 6
|
||||
https://orcid.org/0000-0002-8030-3866 | 6
|
||||
https://orcid.org/0000-0002-8073-9344 | 6
|
||||
https://orcid.org/0000-0002-8087-3199 | 6
|
||||
https://orcid.org/0000-0002-8255-0086 | 6
|
||||
https://orcid.org/0000-0002-8377-6431 | 6
|
||||
https://orcid.org/0000-0002-8738-1453 | 6
|
||||
https://orcid.org/0000-0002-9054-4372 | 6
|
||||
https://orcid.org/0000-0002-9264-4799 | 6
|
||||
https://orcid.org/0000-0002-9337-3476 | 6
|
||||
https://orcid.org/0000-0002-9557-5186 | 6
|
||||
https://orcid.org/0000-0002-9773-550X | 6
|
||||
https://orcid.org/0000-0002-9783-169X | 6
|
||||
https://orcid.org/0000-0002-9858-8249 | 6
|
||||
https://orcid.org/0000-0002-9922-413X | 6
|
||||
https://orcid.org/0000-0003-0133-1664 | 6
|
||||
https://orcid.org/0000-0003-0355-102X | 6
|
||||
https://orcid.org/0000-0003-0392-8691 | 6
|
||||
https://orcid.org/0000-0003-0523-487X | 6
|
||||
https://orcid.org/0000-0003-0959-4784 | 6
|
||||
https://orcid.org/0000-0003-0996-3279 | 6
|
||||
https://orcid.org/0000-0003-1179-2800 | 6
|
||||
https://orcid.org/0000-0003-1452-7885 | 6
|
||||
https://orcid.org/0000-0003-1455-6272 | 6
|
||||
https://orcid.org/0000-0003-1836-7233 | 6
|
||||
https://orcid.org/0000-0003-1890-2275 | 6
|
||||
https://orcid.org/0000-0003-1899-2266 | 6
|
||||
https://orcid.org/0000-0003-2000-2241 | 6
|
||||
https://orcid.org/0000-0003-2294-7345 | 6
|
||||
https://orcid.org/0000-0003-2375-1563 | 6
|
||||
https://orcid.org/0000-0003-2459-6278 | 6
|
||||
https://orcid.org/0000-0003-2582-6469 | 6
|
||||
https://orcid.org/0000-0003-2663-7379 | 6
|
||||
https://orcid.org/0000-0003-2682-9389 | 6
|
||||
https://orcid.org/0000-0003-2865-8528 | 6
|
||||
https://orcid.org/0000-0003-3086-9260 | 6
|
||||
https://orcid.org/0000-0003-3150-2751 | 6
|
||||
https://orcid.org/0000-0003-3389-2976 | 6
|
||||
https://orcid.org/0000-0003-3887-5358 | 6
|
||||
https://orcid.org/0000-0003-4009-186X | 6
|
||||
https://orcid.org/0000-0003-4221-1802 | 6
|
||||
https://orcid.org/0000-0003-4242-4840 | 6
|
||||
https://orcid.org/0000-0003-4351-0222 | 6
|
||||
https://orcid.org/0000-0003-4530-4422 | 6
|
||||
https://orcid.org/0000-0003-4543-2547 | 6
|
||||
https://orcid.org/0000-0003-4579-728X | 6
|
||||
https://orcid.org/0000-0003-4709-7623 | 6
|
||||
https://orcid.org/0009-0000-3973-2485 | 6
|
||||
https://orcid.org/0009-0000-7046-6533 | 6
|
||||
https://orcid.org/0009-0000-8362-2515 | 6
|
||||
https://orcid.org/0009-0000-9361-3532 | 6
|
||||
https://orcid.org/0009-0001-1326-3956 | 6
|
||||
https://orcid.org/0009-0001-7616-1914 | 6
|
||||
https://orcid.org/0009-0001-9331-5145 | 6
|
||||
https://orcid.org/0009-0002-2161-5808 | 6
|
||||
https://orcid.org/0009-0002-2307-5956 | 6
|
||||
https://orcid.org/0009-0002-2345-7081 | 6
|
||||
https://orcid.org/0009-0002-6494-4695 | 6
|
||||
https://orcid.org/0009-0002-8107-5452 | 6
|
||||
https://orcid.org/0009-0002-9187-7061 | 6
|
||||
https://orcid.org/0009-0003-6977-3669 | 6
|
||||
https://orcid.org/0009-0003-9152-2049 | 6
|
||||
https://orcid.org/0009-0004-1874-2464 | 6
|
||||
https://orcid.org/0009-0004-8274-9863 | 6
|
||||
https://orcid.org/0009-0004-8503-4011 | 6
|
||||
https://orcid.org/0009-0005-2318-6084 | 6
|
||||
https://orcid.org/0009-0005-5039-4874 | 6
|
||||
https://orcid.org/0009-0005-5447-7132 | 6
|
||||
https://orcid.org/0009-0005-5922-8936 | 6
|
||||
https://orcid.org/0009-0005-7626-6600 | 6
|
||||
https://orcid.org/0009-0006-0236-2680 | 6
|
||||
https://orcid.org/0009-0006-1471-986X | 6
|
||||
https://orcid.org/0009-0006-5800-1198 | 6
|
||||
https://orcid.org/0009-0006-6993-8920 | 6
|
||||
https://orcid.org/0009-0006-7450-4510 | 6
|
||||
https://orcid.org/0009-0006-8301-7634 | 6
|
||||
https://orcid.org/0009-0006-8497-9085 | 6
|
||||
https://orcid.org/0009-0007-0410-4607 | 6
|
||||
https://orcid.org/0009-0007-1385-3343 | 6
|
||||
https://orcid.org/0009-0007-4527-7926 | 6
|
||||
https://orcid.org/0009-0008-1549-0440 | 6
|
||||
https://orcid.org/0009-0008-3724-4603 | 6
|
||||
https://orcid.org/0009-0008-5380-3284 | 6
|
||||
https://orcid.org/0009-0009-3354-7794 | 6
|
||||
https://orcid.org/0009-0009-4284-8943 | 6
|
||||
https://orcid.org/0009-0009-6074-6238 | 6
|
||||
https://orcid.org/0009-0009-9522-8588 | 6
|
||||
https://orcid.org/0000-0001-5094-5879 | 5
|
||||
https://orcid.org/0000-0001-5124-7693 | 5
|
||||
https://orcid.org/0000-0001-5144-7900 | 5
|
||||
https://orcid.org/0000-0001-5552-5400 | 5
|
||||
https://orcid.org/0000-0001-5565-7868 | 5
|
||||
https://orcid.org/0000-0001-5646-0602 | 5
|
||||
https://orcid.org/0000-0001-5650-6770 | 5
|
||||
https://orcid.org/0000-0001-5881-4670 | 5
|
||||
https://orcid.org/0000-0001-5961-9033 | 5
|
||||
https://orcid.org/0000-0001-5979-6590 | 5
|
||||
https://orcid.org/0000-0001-5989-9338 | 5
|
||||
https://orcid.org/0000-0001-6153-3896 | 5
|
||||
https://orcid.org/0000-0001-6253-4313 | 5
|
||||
https://orcid.org/0000-0001-6278-9674 | 5
|
||||
https://orcid.org/0000-0001-6279-2267 | 5
|
||||
https://orcid.org/0000-0001-6326-4773 | 5
|
||||
https://orcid.org/0000-0001-6342-3471 | 5
|
||||
https://orcid.org/0000-0001-6453-0447 | 5
|
||||
https://orcid.org/0000-0001-6797-4000 | 5
|
||||
https://orcid.org/0000-0001-6828-9769 | 5
|
||||
https://orcid.org/0000-0001-6867-8166 | 5
|
||||
https://orcid.org/0000-0001-6930-4780 | 5
|
||||
https://orcid.org/0000-0001-6976-6256 | 5
|
||||
https://orcid.org/0000-0001-7256-6714 | 5
|
||||
https://orcid.org/0000-0001-7516-8850 | 5
|
||||
https://orcid.org/0000-0001-7759-1943 | 5
|
||||
https://orcid.org/0000-0001-7770-1102 | 5
|
||||
https://orcid.org/0000-0001-7896-8861 | 5
|
||||
https://orcid.org/0000-0001-8026-5380 | 5
|
||||
https://orcid.org/0000-0001-8049-5143 | 5
|
||||
https://orcid.org/0000-0001-8130-7423 | 5
|
||||
https://orcid.org/0000-0001-8140-4610 | 5
|
||||
https://orcid.org/0000-0001-8204-6157 | 5
|
||||
https://orcid.org/0000-0001-8292-7691 | 5
|
||||
https://orcid.org/0000-0001-8331-4854 | 5
|
||||
https://orcid.org/0000-0001-8367-8703 | 5
|
||||
https://orcid.org/0000-0001-8387-1853 | 5
|
||||
https://orcid.org/0000-0001-8415-6720 | 5
|
||||
https://orcid.org/0000-0001-8430-0446 | 5
|
||||
https://orcid.org/0000-0001-8463-0496 | 5
|
||||
https://orcid.org/0000-0001-8493-3737 | 5
|
||||
https://orcid.org/0000-0001-8647-7077 | 5
|
||||
https://orcid.org/0000-0001-8719-057X | 5
|
||||
https://orcid.org/0000-0001-8751-5944 | 5
|
||||
https://orcid.org/0000-0001-8785-847X | 5
|
||||
https://orcid.org/0000-0001-8791-7978 | 5
|
||||
https://orcid.org/0000-0001-8810-5971 | 5
|
||||
https://orcid.org/0000-0001-8828-3823 | 5
|
||||
https://orcid.org/0000-0001-8829-9681 | 5
|
||||
https://orcid.org/0000-0001-9012-395X | 5
|
||||
https://orcid.org/0000-0001-9031-6751 | 5
|
||||
https://orcid.org/0000-0001-9034-2925 | 5
|
||||
https://orcid.org/0000-0001-9048-4341 | 5
|
||||
https://orcid.org/0000-0001-9094-1493 | 5
|
||||
https://orcid.org/0000-0001-9301-2382 | 5
|
||||
https://orcid.org/0000-0001-9365-6452 | 5
|
||||
https://orcid.org/0000-0001-9440-5807 | 5
|
||||
https://orcid.org/0000-0001-9719-3563 | 5
|
||||
https://orcid.org/0000-0001-9734-574X | 5
|
||||
https://orcid.org/0000-0001-9861-2942 | 5
|
||||
https://orcid.org/0000-0002-0035-3821 | 5
|
||||
https://orcid.org/0000-0002-0044-6470 | 5
|
||||
https://orcid.org/0000-0002-0224-2869 | 5
|
||||
https://orcid.org/0000-0002-0286-5070 | 5
|
||||
https://orcid.org/0000-0002-0550-457X | 5
|
||||
https://orcid.org/0000-0002-0554-4627 | 5
|
||||
https://orcid.org/0000-0002-0608-065X | 5
|
||||
https://orcid.org/0000-0002-0653-0761 | 5
|
||||
https://orcid.org/0000-0002-0672-6895 | 5
|
||||
https://orcid.org/0000-0002-0804-9197 | 5
|
||||
https://orcid.org/0000-0002-0809-1897 | 5
|
||||
https://orcid.org/0000-0002-0870-8420 | 5
|
||||
https://orcid.org/0000-0002-0984-7887 | 5
|
||||
https://orcid.org/0000-0002-1034-1410 | 5
|
||||
https://orcid.org/0000-0002-1182-7869 | 5
|
||||
https://orcid.org/0000-0002-1303-0458 | 5
|
||||
https://orcid.org/0000-0002-1394-9907 | 5
|
||||
@@ -0,0 +1,503 @@
|
||||
Analyse 2: Wie Analyse 1, zusätzlich mit der Anzahl unterschiedlicher display_names je ORCID (exakter Match) — trennt echte Namens-Duplikate von unterschiedlich benannten Autoren mit derselben ORCID.
|
||||
ORCID | Gesamt | Unique Names
|
||||
------------------------------------- | ------ | ------------
|
||||
https://orcid.org/0000-0002-1652-6686 | 37 | 37
|
||||
https://orcid.org/0000-0002-3394-1507 | 35 | 29
|
||||
https://orcid.org/0000-0001-9708-5765 | 34 | 18
|
||||
https://orcid.org/0000-0002-3156-3741 | 31 | 16
|
||||
https://orcid.org/0000-0001-8829-9817 | 30 | 6
|
||||
https://orcid.org/0000-0003-3256-740X | 28 | 2
|
||||
https://orcid.org/0000-0003-3875-3561 | 28 | 28
|
||||
https://orcid.org/0009-0006-5046-8527 | 28 | 17
|
||||
https://orcid.org/0000-0003-1006-7594 | 27 | 27
|
||||
https://orcid.org/0000-0002-0439-1390 | 23 | 17
|
||||
https://orcid.org/0000-0003-3112-4252 | 23 | 12
|
||||
https://orcid.org/0000-0001-8601-2325 | 22 | 5
|
||||
https://orcid.org/0000-0002-1276-5858 | 22 | 6
|
||||
https://orcid.org/0000-0001-8418-5054 | 21 | 19
|
||||
https://orcid.org/0000-0002-0482-2111 | 20 | 19
|
||||
https://orcid.org/0000-0002-5163-0489 | 20 | 1
|
||||
https://orcid.org/0000-0003-4433-5227 | 19 | 15
|
||||
https://orcid.org/0009-0009-5669-1676 | 18 | 1
|
||||
https://orcid.org/0000-0002-6157-2016 | 17 | 14
|
||||
https://orcid.org/0000-0002-0991-5026 | 16 | 13
|
||||
https://orcid.org/0000-0002-3128-9025 | 16 | 14
|
||||
https://orcid.org/0000-0001-9286-2123 | 15 | 7
|
||||
https://orcid.org/0000-0002-0374-7404 | 15 | 15
|
||||
https://orcid.org/0000-0002-3440-2767 | 15 | 13
|
||||
https://orcid.org/0000-0002-9627-5433 | 15 | 15
|
||||
https://orcid.org/0000-0003-3703-6624 | 15 | 12
|
||||
https://orcid.org/0000-0001-5720-6649 | 14 | 9
|
||||
https://orcid.org/0000-0001-9725-2316 | 14 | 13
|
||||
https://orcid.org/0000-0002-5530-0380 | 14 | 11
|
||||
https://orcid.org/0000-0002-9099-6870 | 14 | 10
|
||||
https://orcid.org/0000-0003-4067-1127 | 14 | 8
|
||||
https://orcid.org/0000-0001-5472-562X | 13 | 8
|
||||
https://orcid.org/0000-0001-5818-1682 | 13 | 10
|
||||
https://orcid.org/0000-0001-7575-3603 | 13 | 11
|
||||
https://orcid.org/0000-0001-9532-5075 | 13 | 8
|
||||
https://orcid.org/0000-0002-2413-3858 | 13 | 5
|
||||
https://orcid.org/0000-0003-0910-4095 | 13 | 10
|
||||
https://orcid.org/0000-0003-1983-3435 | 13 | 6
|
||||
https://orcid.org/0000-0001-6463-7869 | 12 | 6
|
||||
https://orcid.org/0000-0002-4424-8345 | 12 | 11
|
||||
https://orcid.org/0000-0002-6170-4744 | 12 | 8
|
||||
https://orcid.org/0000-0002-7836-1100 | 12 | 6
|
||||
https://orcid.org/0000-0002-8407-0369 | 12 | 10
|
||||
https://orcid.org/0000-0003-0524-1914 | 12 | 11
|
||||
https://orcid.org/0009-0002-6108-5477 | 12 | 1
|
||||
https://orcid.org/0009-0004-1348-0805 | 12 | 2
|
||||
https://orcid.org/0009-0004-8479-2072 | 12 | 3
|
||||
https://orcid.org/0009-0008-7694-4987 | 12 | 9
|
||||
https://orcid.org/0000-0001-5286-4423 | 11 | 6
|
||||
https://orcid.org/0000-0001-6470-4662 | 11 | 7
|
||||
https://orcid.org/0000-0001-9234-019X | 11 | 9
|
||||
https://orcid.org/0000-0002-4332-3518 | 11 | 11
|
||||
https://orcid.org/0000-0002-5806-6403 | 11 | 8
|
||||
https://orcid.org/0000-0002-5839-0895 | 11 | 6
|
||||
https://orcid.org/0000-0002-6053-902X | 11 | 8
|
||||
https://orcid.org/0000-0002-6432-7542 | 11 | 8
|
||||
https://orcid.org/0000-0002-8771-3120 | 11 | 6
|
||||
https://orcid.org/0000-0003-3966-3111 | 11 | 1
|
||||
https://orcid.org/0009-0002-5212-4710 | 11 | 1
|
||||
https://orcid.org/0009-0009-8910-1396 | 11 | 1
|
||||
https://orcid.org/0000-0001-5866-1504 | 10 | 9
|
||||
https://orcid.org/0000-0001-6623-1205 | 10 | 9
|
||||
https://orcid.org/0000-0001-6717-0803 | 10 | 6
|
||||
https://orcid.org/0000-0001-6825-5956 | 10 | 1
|
||||
https://orcid.org/0000-0001-7954-1149 | 10 | 3
|
||||
https://orcid.org/0000-0001-8075-2867 | 10 | 9
|
||||
https://orcid.org/0000-0001-9061-4281 | 10 | 3
|
||||
https://orcid.org/0000-0002-0124-9065 | 10 | 1
|
||||
https://orcid.org/0000-0002-1153-816X | 10 | 2
|
||||
https://orcid.org/0000-0002-1528-4865 | 10 | 8
|
||||
https://orcid.org/0000-0002-2283-1863 | 10 | 6
|
||||
https://orcid.org/0000-0002-3236-6766 | 10 | 8
|
||||
https://orcid.org/0000-0002-3789-0081 | 10 | 1
|
||||
https://orcid.org/0000-0002-5076-7803 | 10 | 7
|
||||
https://orcid.org/0000-0002-6925-5189 | 10 | 1
|
||||
https://orcid.org/0000-0003-0056-7296 | 10 | 10
|
||||
https://orcid.org/0000-0003-1685-7968 | 10 | 8
|
||||
https://orcid.org/0000-0003-1785-3491 | 10 | 6
|
||||
https://orcid.org/0000-0003-2076-1133 | 10 | 7
|
||||
https://orcid.org/0000-0003-2098-3844 | 10 | 2
|
||||
https://orcid.org/0000-0003-4632-0213 | 10 | 8
|
||||
https://orcid.org/0009-0006-5916-3682 | 10 | 1
|
||||
https://orcid.org/0000-0001-5728-871X | 9 | 6
|
||||
https://orcid.org/0000-0001-8551-7866 | 9 | 4
|
||||
https://orcid.org/0000-0001-9384-6598 | 9 | 3
|
||||
https://orcid.org/0000-0001-9548-0358 | 9 | 6
|
||||
https://orcid.org/0000-0001-9853-6257 | 9 | 1
|
||||
https://orcid.org/0000-0002-0374-1838 | 9 | 6
|
||||
https://orcid.org/0000-0002-1122-0055 | 9 | 5
|
||||
https://orcid.org/0000-0002-1157-1859 | 9 | 4
|
||||
https://orcid.org/0000-0002-3633-7065 | 9 | 3
|
||||
https://orcid.org/0000-0002-3864-9257 | 9 | 9
|
||||
https://orcid.org/0000-0002-4817-7775 | 9 | 5
|
||||
https://orcid.org/0000-0002-6374-458X | 9 | 6
|
||||
https://orcid.org/0000-0002-6758-0113 | 9 | 8
|
||||
https://orcid.org/0000-0002-6764-4789 | 9 | 2
|
||||
https://orcid.org/0000-0002-9763-9155 | 9 | 7
|
||||
https://orcid.org/0000-0003-1112-8336 | 9 | 6
|
||||
https://orcid.org/0000-0003-4667-3502 | 9 | 3
|
||||
https://orcid.org/0009-0000-8033-8498 | 9 | 1
|
||||
https://orcid.org/0009-0001-0761-7543 | 9 | 1
|
||||
https://orcid.org/0009-0001-4259-5917 | 9 | 2
|
||||
https://orcid.org/0009-0002-3680-1224 | 9 | 1
|
||||
https://orcid.org/0009-0002-8176-3757 | 9 | 1
|
||||
https://orcid.org/0009-0002-8563-7248 | 9 | 3
|
||||
https://orcid.org/0009-0006-3511-9329 | 9 | 9
|
||||
https://orcid.org/0009-0007-2108-5110 | 9 | 2
|
||||
https://orcid.org/0009-0008-8730-8097 | 9 | 1
|
||||
https://orcid.org/0009-0009-8845-6742 | 9 | 1
|
||||
https://orcid.org/0000-0001-5233-3139 | 8 | 6
|
||||
https://orcid.org/0000-0001-5252-0831 | 8 | 6
|
||||
https://orcid.org/0000-0001-5775-7993 | 8 | 2
|
||||
https://orcid.org/0000-0001-6072-3874 | 8 | 1
|
||||
https://orcid.org/0000-0001-6819-6562 | 8 | 1
|
||||
https://orcid.org/0000-0001-6923-7936 | 8 | 5
|
||||
https://orcid.org/0000-0002-0584-8700 | 8 | 7
|
||||
https://orcid.org/0000-0002-1129-2083 | 8 | 6
|
||||
https://orcid.org/0000-0002-1959-2363 | 8 | 5
|
||||
https://orcid.org/0000-0002-2079-996X | 8 | 6
|
||||
https://orcid.org/0000-0002-2106-4041 | 8 | 4
|
||||
https://orcid.org/0000-0002-2745-5908 | 8 | 4
|
||||
https://orcid.org/0000-0002-3225-2769 | 8 | 8
|
||||
https://orcid.org/0000-0002-3365-3927 | 8 | 8
|
||||
https://orcid.org/0000-0002-3397-3496 | 8 | 5
|
||||
https://orcid.org/0000-0002-3650-4548 | 8 | 1
|
||||
https://orcid.org/0000-0002-3934-6004 | 8 | 5
|
||||
https://orcid.org/0000-0002-4006-7029 | 8 | 7
|
||||
https://orcid.org/0000-0002-4485-6017 | 8 | 4
|
||||
https://orcid.org/0000-0002-4974-7004 | 8 | 7
|
||||
https://orcid.org/0000-0002-5105-1305 | 8 | 1
|
||||
https://orcid.org/0000-0002-5380-9829 | 8 | 1
|
||||
https://orcid.org/0000-0002-6047-4211 | 8 | 1
|
||||
https://orcid.org/0000-0002-6999-3931 | 8 | 7
|
||||
https://orcid.org/0000-0002-7007-9020 | 8 | 2
|
||||
https://orcid.org/0000-0002-9808-5035 | 8 | 3
|
||||
https://orcid.org/0000-0003-0660-596X | 8 | 2
|
||||
https://orcid.org/0000-0003-0664-1653 | 8 | 6
|
||||
https://orcid.org/0000-0003-0766-6174 | 8 | 3
|
||||
https://orcid.org/0000-0003-1925-4337 | 8 | 1
|
||||
https://orcid.org/0000-0003-2320-7621 | 8 | 5
|
||||
https://orcid.org/0000-0003-2611-1975 | 8 | 7
|
||||
https://orcid.org/0000-0003-2623-3198 | 8 | 7
|
||||
https://orcid.org/0000-0003-3223-1797 | 8 | 5
|
||||
https://orcid.org/0000-0003-3303-7769 | 8 | 1
|
||||
https://orcid.org/0000-0003-4556-7302 | 8 | 3
|
||||
https://orcid.org/0000-0003-4813-8167 | 8 | 6
|
||||
https://orcid.org/0009-0000-3081-2665 | 8 | 3
|
||||
https://orcid.org/0009-0000-4054-8239 | 8 | 1
|
||||
https://orcid.org/0009-0001-1173-3651 | 8 | 1
|
||||
https://orcid.org/0009-0002-4054-6799 | 8 | 1
|
||||
https://orcid.org/0009-0004-1393-6577 | 8 | 2
|
||||
https://orcid.org/0009-0004-2581-9917 | 8 | 1
|
||||
https://orcid.org/0009-0005-7271-2677 | 8 | 1
|
||||
https://orcid.org/0009-0006-1867-9674 | 8 | 2
|
||||
https://orcid.org/0009-0007-7218-9227 | 8 | 3
|
||||
https://orcid.org/0009-0008-2045-2609 | 8 | 1
|
||||
https://orcid.org/0009-0008-2532-8674 | 8 | 1
|
||||
https://orcid.org/0009-0009-0129-3267 | 8 | 2
|
||||
https://orcid.org/0000-0001-2345-6789 | 7 | 7
|
||||
https://orcid.org/0000-0001-5189-230X | 7 | 1
|
||||
https://orcid.org/0000-0001-5501-554X | 7 | 6
|
||||
https://orcid.org/0000-0001-5987-3189 | 7 | 2
|
||||
https://orcid.org/0000-0001-6057-9243 | 7 | 7
|
||||
https://orcid.org/0000-0001-6105-5345 | 7 | 3
|
||||
https://orcid.org/0000-0001-6436-7547 | 7 | 6
|
||||
https://orcid.org/0000-0001-6533-6144 | 7 | 7
|
||||
https://orcid.org/0000-0001-6850-7666 | 7 | 6
|
||||
https://orcid.org/0000-0001-6883-3752 | 7 | 1
|
||||
https://orcid.org/0000-0001-7483-2991 | 7 | 2
|
||||
https://orcid.org/0000-0001-7515-3907 | 7 | 4
|
||||
https://orcid.org/0000-0001-7945-2867 | 7 | 5
|
||||
https://orcid.org/0000-0001-8191-0046 | 7 | 3
|
||||
https://orcid.org/0000-0001-8555-5408 | 7 | 1
|
||||
https://orcid.org/0000-0001-9190-4547 | 7 | 6
|
||||
https://orcid.org/0000-0001-9539-2155 | 7 | 5
|
||||
https://orcid.org/0000-0001-9663-4443 | 7 | 5
|
||||
https://orcid.org/0000-0002-0117-7831 | 7 | 1
|
||||
https://orcid.org/0000-0002-0207-2871 | 7 | 1
|
||||
https://orcid.org/0000-0002-0394-5646 | 7 | 5
|
||||
https://orcid.org/0000-0002-0869-5631 | 7 | 2
|
||||
https://orcid.org/0000-0002-1051-3833 | 7 | 3
|
||||
https://orcid.org/0000-0002-1122-2990 | 7 | 1
|
||||
https://orcid.org/0000-0002-1695-9481 | 7 | 4
|
||||
https://orcid.org/0000-0002-1933-5383 | 7 | 4
|
||||
https://orcid.org/0000-0002-2023-2082 | 7 | 7
|
||||
https://orcid.org/0000-0002-2115-9382 | 7 | 5
|
||||
https://orcid.org/0000-0002-2138-4395 | 7 | 4
|
||||
https://orcid.org/0000-0002-2405-915X | 7 | 2
|
||||
https://orcid.org/0000-0002-2593-5297 | 7 | 2
|
||||
https://orcid.org/0000-0002-2629-4735 | 7 | 1
|
||||
https://orcid.org/0000-0002-2699-2189 | 7 | 1
|
||||
https://orcid.org/0000-0002-2782-9519 | 7 | 7
|
||||
https://orcid.org/0000-0002-3135-5010 | 7 | 5
|
||||
https://orcid.org/0000-0002-3348-1221 | 7 | 1
|
||||
https://orcid.org/0000-0002-3725-4800 | 7 | 4
|
||||
https://orcid.org/0000-0002-4133-5099 | 7 | 2
|
||||
https://orcid.org/0000-0002-4242-2450 | 7 | 6
|
||||
https://orcid.org/0000-0002-4526-2149 | 7 | 2
|
||||
https://orcid.org/0000-0002-4996-1924 | 7 | 6
|
||||
https://orcid.org/0000-0002-5540-3750 | 7 | 4
|
||||
https://orcid.org/0000-0002-5956-6258 | 7 | 2
|
||||
https://orcid.org/0000-0002-6519-4681 | 7 | 1
|
||||
https://orcid.org/0000-0002-7602-2527 | 7 | 4
|
||||
https://orcid.org/0000-0002-8002-9086 | 7 | 6
|
||||
https://orcid.org/0000-0002-8482-1046 | 7 | 4
|
||||
https://orcid.org/0000-0002-8640-4350 | 7 | 2
|
||||
https://orcid.org/0000-0002-9192-8757 | 7 | 3
|
||||
https://orcid.org/0000-0002-9241-3114 | 7 | 4
|
||||
https://orcid.org/0000-0002-9581-2778 | 7 | 4
|
||||
https://orcid.org/0000-0002-9749-5550 | 7 | 5
|
||||
https://orcid.org/0000-0002-9878-6077 | 7 | 1
|
||||
https://orcid.org/0000-0003-0195-7456 | 7 | 4
|
||||
https://orcid.org/0000-0003-0266-0224 | 7 | 3
|
||||
https://orcid.org/0000-0003-0362-8795 | 7 | 7
|
||||
https://orcid.org/0000-0003-0383-6930 | 7 | 1
|
||||
https://orcid.org/0000-0003-0609-627X | 7 | 2
|
||||
https://orcid.org/0000-0003-1287-1471 | 7 | 7
|
||||
https://orcid.org/0000-0003-1430-9191 | 7 | 5
|
||||
https://orcid.org/0000-0003-1731-7939 | 7 | 2
|
||||
https://orcid.org/0000-0003-2298-0102 | 7 | 3
|
||||
https://orcid.org/0000-0003-2323-7521 | 7 | 7
|
||||
https://orcid.org/0000-0003-2707-2533 | 7 | 5
|
||||
https://orcid.org/0000-0003-2868-7177 | 7 | 2
|
||||
https://orcid.org/0000-0003-2973-1803 | 7 | 2
|
||||
https://orcid.org/0000-0003-3609-4777 | 7 | 6
|
||||
https://orcid.org/0000-0003-3895-9092 | 7 | 1
|
||||
https://orcid.org/0000-0003-4316-9642 | 7 | 1
|
||||
https://orcid.org/0000-0003-4950-5184 | 7 | 1
|
||||
https://orcid.org/0009-0000-7239-3374 | 7 | 1
|
||||
https://orcid.org/0009-0000-8636-0848 | 7 | 2
|
||||
https://orcid.org/0009-0001-7282-8881 | 7 | 3
|
||||
https://orcid.org/0009-0002-0885-5145 | 7 | 1
|
||||
https://orcid.org/0009-0002-1063-5117 | 7 | 1
|
||||
https://orcid.org/0009-0002-3352-6765 | 7 | 3
|
||||
https://orcid.org/0009-0002-4224-5527 | 7 | 1
|
||||
https://orcid.org/0009-0002-9160-3095 | 7 | 1
|
||||
https://orcid.org/0009-0002-9671-101X | 7 | 3
|
||||
https://orcid.org/0009-0003-4314-9534 | 7 | 1
|
||||
https://orcid.org/0009-0004-6991-0595 | 7 | 4
|
||||
https://orcid.org/0009-0005-5603-6306 | 7 | 1
|
||||
https://orcid.org/0009-0005-8813-8745 | 7 | 1
|
||||
https://orcid.org/0009-0006-9312-0272 | 7 | 1
|
||||
https://orcid.org/0009-0007-1509-2728 | 7 | 5
|
||||
https://orcid.org/0009-0007-6670-9679 | 7 | 1
|
||||
https://orcid.org/0009-0008-0310-0257 | 7 | 1
|
||||
https://orcid.org/0009-0009-4592-6687 | 7 | 1
|
||||
https://orcid.org/0009-0009-8645-6685 | 7 | 2
|
||||
https://orcid.org/0000-0001-5001-672X | 6 | 2
|
||||
https://orcid.org/0000-0001-5637-2653 | 6 | 2
|
||||
https://orcid.org/0000-0001-5769-5761 | 6 | 3
|
||||
https://orcid.org/0000-0001-5854-7699 | 6 | 2
|
||||
https://orcid.org/0000-0001-5967-8674 | 6 | 4
|
||||
https://orcid.org/0000-0001-6805-0395 | 6 | 1
|
||||
https://orcid.org/0000-0001-6996-4834 | 6 | 3
|
||||
https://orcid.org/0000-0001-7179-7043 | 6 | 3
|
||||
https://orcid.org/0000-0001-7241-2117 | 6 | 4
|
||||
https://orcid.org/0000-0001-7833-4711 | 6 | 2
|
||||
https://orcid.org/0000-0001-7842-9518 | 6 | 3
|
||||
https://orcid.org/0000-0001-7941-4879 | 6 | 6
|
||||
https://orcid.org/0000-0001-8178-2494 | 6 | 1
|
||||
https://orcid.org/0000-0001-8375-0760 | 6 | 3
|
||||
https://orcid.org/0000-0001-8473-4332 | 6 | 4
|
||||
https://orcid.org/0000-0001-8569-8409 | 6 | 3
|
||||
https://orcid.org/0000-0001-8673-3026 | 6 | 3
|
||||
https://orcid.org/0000-0001-8915-3377 | 6 | 6
|
||||
https://orcid.org/0000-0001-9025-2225 | 6 | 2
|
||||
https://orcid.org/0000-0001-9086-6091 | 6 | 5
|
||||
https://orcid.org/0000-0001-9140-9028 | 6 | 1
|
||||
https://orcid.org/0000-0001-9234-4465 | 6 | 5
|
||||
https://orcid.org/0000-0001-9416-1742 | 6 | 2
|
||||
https://orcid.org/0000-0001-9422-1725 | 6 | 6
|
||||
https://orcid.org/0000-0001-9473-8935 | 6 | 3
|
||||
https://orcid.org/0000-0001-9524-8452 | 6 | 6
|
||||
https://orcid.org/0000-0001-9630-2000 | 6 | 2
|
||||
https://orcid.org/0000-0001-9734-3162 | 6 | 3
|
||||
https://orcid.org/0000-0001-9861-8922 | 6 | 3
|
||||
https://orcid.org/0000-0002-0032-4473 | 6 | 5
|
||||
https://orcid.org/0000-0002-0034-6576 | 6 | 2
|
||||
https://orcid.org/0000-0002-0038-5372 | 6 | 2
|
||||
https://orcid.org/0000-0002-0144-6536 | 6 | 4
|
||||
https://orcid.org/0000-0002-0264-7217 | 6 | 2
|
||||
https://orcid.org/0000-0002-0531-2148 | 6 | 2
|
||||
https://orcid.org/0000-0002-0538-8230 | 6 | 5
|
||||
https://orcid.org/0000-0002-0595-0297 | 6 | 2
|
||||
https://orcid.org/0000-0002-0657-1766 | 6 | 5
|
||||
https://orcid.org/0000-0002-0661-5220 | 6 | 1
|
||||
https://orcid.org/0000-0002-0664-9199 | 6 | 5
|
||||
https://orcid.org/0000-0002-0682-4313 | 6 | 5
|
||||
https://orcid.org/0000-0002-0786-7307 | 6 | 5
|
||||
https://orcid.org/0000-0002-0798-9806 | 6 | 2
|
||||
https://orcid.org/0000-0002-0857-6317 | 6 | 2
|
||||
https://orcid.org/0000-0002-1115-4721 | 6 | 3
|
||||
https://orcid.org/0000-0002-1231-5136 | 6 | 1
|
||||
https://orcid.org/0000-0002-1640-9180 | 6 | 6
|
||||
https://orcid.org/0000-0002-2133-9287 | 6 | 2
|
||||
https://orcid.org/0000-0002-2140-4309 | 6 | 1
|
||||
https://orcid.org/0000-0002-2141-9543 | 6 | 5
|
||||
https://orcid.org/0000-0002-2204-5731 | 6 | 4
|
||||
https://orcid.org/0000-0002-2495-0524 | 6 | 1
|
||||
https://orcid.org/0000-0002-2629-5420 | 6 | 1
|
||||
https://orcid.org/0000-0002-2745-7065 | 6 | 1
|
||||
https://orcid.org/0000-0002-2896-3867 | 6 | 2
|
||||
https://orcid.org/0000-0002-3122-7617 | 6 | 4
|
||||
https://orcid.org/0000-0002-3728-2377 | 6 | 5
|
||||
https://orcid.org/0000-0002-3812-4944 | 6 | 5
|
||||
https://orcid.org/0000-0002-3820-9366 | 6 | 2
|
||||
https://orcid.org/0000-0002-3871-0978 | 6 | 1
|
||||
https://orcid.org/0000-0002-4125-8898 | 6 | 3
|
||||
https://orcid.org/0000-0002-4620-4223 | 6 | 1
|
||||
https://orcid.org/0000-0002-4624-2019 | 6 | 3
|
||||
https://orcid.org/0000-0002-4743-8718 | 6 | 1
|
||||
https://orcid.org/0000-0002-4841-3600 | 6 | 5
|
||||
https://orcid.org/0000-0002-4902-5589 | 6 | 1
|
||||
https://orcid.org/0000-0002-5005-3042 | 6 | 3
|
||||
https://orcid.org/0000-0002-5278-1430 | 6 | 3
|
||||
https://orcid.org/0000-0002-5414-8276 | 6 | 5
|
||||
https://orcid.org/0000-0002-5661-4330 | 6 | 5
|
||||
https://orcid.org/0000-0002-5728-9867 | 6 | 1
|
||||
https://orcid.org/0000-0002-5735-4059 | 6 | 3
|
||||
https://orcid.org/0000-0002-5736-1398 | 6 | 5
|
||||
https://orcid.org/0000-0002-5865-183X | 6 | 6
|
||||
https://orcid.org/0000-0002-5890-0445 | 6 | 1
|
||||
https://orcid.org/0000-0002-6083-2656 | 6 | 2
|
||||
https://orcid.org/0000-0002-6330-0639 | 6 | 1
|
||||
https://orcid.org/0000-0002-6469-8415 | 6 | 3
|
||||
https://orcid.org/0000-0002-6513-2309 | 6 | 2
|
||||
https://orcid.org/0000-0002-6781-416X | 6 | 1
|
||||
https://orcid.org/0000-0002-6785-9202 | 6 | 5
|
||||
https://orcid.org/0000-0002-6797-7209 | 6 | 2
|
||||
https://orcid.org/0000-0002-6941-8478 | 6 | 2
|
||||
https://orcid.org/0000-0002-7093-2677 | 6 | 2
|
||||
https://orcid.org/0000-0002-7225-8823 | 6 | 4
|
||||
https://orcid.org/0000-0002-7447-5602 | 6 | 2
|
||||
https://orcid.org/0000-0002-7543-1628 | 6 | 1
|
||||
https://orcid.org/0000-0002-7581-846X | 6 | 3
|
||||
https://orcid.org/0000-0002-7929-5889 | 6 | 5
|
||||
https://orcid.org/0000-0002-7989-6406 | 6 | 1
|
||||
https://orcid.org/0000-0002-8030-3866 | 6 | 2
|
||||
https://orcid.org/0000-0002-8073-9344 | 6 | 3
|
||||
https://orcid.org/0000-0002-8087-3199 | 6 | 2
|
||||
https://orcid.org/0000-0002-8255-0086 | 6 | 3
|
||||
https://orcid.org/0000-0002-8377-6431 | 6 | 2
|
||||
https://orcid.org/0000-0002-8738-1453 | 6 | 5
|
||||
https://orcid.org/0000-0002-9054-4372 | 6 | 5
|
||||
https://orcid.org/0000-0002-9264-4799 | 6 | 1
|
||||
https://orcid.org/0000-0002-9337-3476 | 6 | 4
|
||||
https://orcid.org/0000-0002-9557-5186 | 6 | 1
|
||||
https://orcid.org/0000-0002-9773-550X | 6 | 3
|
||||
https://orcid.org/0000-0002-9783-169X | 6 | 5
|
||||
https://orcid.org/0000-0002-9858-8249 | 6 | 4
|
||||
https://orcid.org/0000-0002-9922-413X | 6 | 2
|
||||
https://orcid.org/0000-0003-0133-1664 | 6 | 2
|
||||
https://orcid.org/0000-0003-0355-102X | 6 | 2
|
||||
https://orcid.org/0000-0003-0392-8691 | 6 | 2
|
||||
https://orcid.org/0000-0003-0523-487X | 6 | 5
|
||||
https://orcid.org/0000-0003-0959-4784 | 6 | 2
|
||||
https://orcid.org/0000-0003-0996-3279 | 6 | 5
|
||||
https://orcid.org/0000-0003-1179-2800 | 6 | 4
|
||||
https://orcid.org/0000-0003-1452-7885 | 6 | 2
|
||||
https://orcid.org/0000-0003-1455-6272 | 6 | 3
|
||||
https://orcid.org/0000-0003-1836-7233 | 6 | 1
|
||||
https://orcid.org/0000-0003-1890-2275 | 6 | 5
|
||||
https://orcid.org/0000-0003-1899-2266 | 6 | 3
|
||||
https://orcid.org/0000-0003-2000-2241 | 6 | 1
|
||||
https://orcid.org/0000-0003-2294-7345 | 6 | 4
|
||||
https://orcid.org/0000-0003-2375-1563 | 6 | 2
|
||||
https://orcid.org/0000-0003-2459-6278 | 6 | 1
|
||||
https://orcid.org/0000-0003-2582-6469 | 6 | 5
|
||||
https://orcid.org/0000-0003-2663-7379 | 6 | 2
|
||||
https://orcid.org/0000-0003-2682-9389 | 6 | 1
|
||||
https://orcid.org/0000-0003-2865-8528 | 6 | 3
|
||||
https://orcid.org/0000-0003-3086-9260 | 6 | 1
|
||||
https://orcid.org/0000-0003-3150-2751 | 6 | 5
|
||||
https://orcid.org/0000-0003-3389-2976 | 6 | 6
|
||||
https://orcid.org/0000-0003-3887-5358 | 6 | 2
|
||||
https://orcid.org/0000-0003-4009-186X | 6 | 2
|
||||
https://orcid.org/0000-0003-4221-1802 | 6 | 2
|
||||
https://orcid.org/0000-0003-4242-4840 | 6 | 2
|
||||
https://orcid.org/0000-0003-4351-0222 | 6 | 2
|
||||
https://orcid.org/0000-0003-4530-4422 | 6 | 1
|
||||
https://orcid.org/0000-0003-4543-2547 | 6 | 1
|
||||
https://orcid.org/0000-0003-4579-728X | 6 | 4
|
||||
https://orcid.org/0000-0003-4709-7623 | 6 | 2
|
||||
https://orcid.org/0009-0000-3973-2485 | 6 | 2
|
||||
https://orcid.org/0009-0000-7046-6533 | 6 | 2
|
||||
https://orcid.org/0009-0000-8362-2515 | 6 | 1
|
||||
https://orcid.org/0009-0000-9361-3532 | 6 | 1
|
||||
https://orcid.org/0009-0001-1326-3956 | 6 | 3
|
||||
https://orcid.org/0009-0001-7616-1914 | 6 | 5
|
||||
https://orcid.org/0009-0001-9331-5145 | 6 | 2
|
||||
https://orcid.org/0009-0002-2161-5808 | 6 | 3
|
||||
https://orcid.org/0009-0002-2307-5956 | 6 | 2
|
||||
https://orcid.org/0009-0002-2345-7081 | 6 | 2
|
||||
https://orcid.org/0009-0002-6494-4695 | 6 | 3
|
||||
https://orcid.org/0009-0002-8107-5452 | 6 | 1
|
||||
https://orcid.org/0009-0002-9187-7061 | 6 | 2
|
||||
https://orcid.org/0009-0003-6977-3669 | 6 | 2
|
||||
https://orcid.org/0009-0003-9152-2049 | 6 | 3
|
||||
https://orcid.org/0009-0004-1874-2464 | 6 | 1
|
||||
https://orcid.org/0009-0004-8274-9863 | 6 | 6
|
||||
https://orcid.org/0009-0004-8503-4011 | 6 | 2
|
||||
https://orcid.org/0009-0005-2318-6084 | 6 | 1
|
||||
https://orcid.org/0009-0005-5039-4874 | 6 | 2
|
||||
https://orcid.org/0009-0005-5447-7132 | 6 | 2
|
||||
https://orcid.org/0009-0005-5922-8936 | 6 | 2
|
||||
https://orcid.org/0009-0005-7626-6600 | 6 | 4
|
||||
https://orcid.org/0009-0006-0236-2680 | 6 | 1
|
||||
https://orcid.org/0009-0006-1471-986X | 6 | 1
|
||||
https://orcid.org/0009-0006-5800-1198 | 6 | 5
|
||||
https://orcid.org/0009-0006-6993-8920 | 6 | 6
|
||||
https://orcid.org/0009-0006-7450-4510 | 6 | 1
|
||||
https://orcid.org/0009-0006-8301-7634 | 6 | 5
|
||||
https://orcid.org/0009-0006-8497-9085 | 6 | 3
|
||||
https://orcid.org/0009-0007-0410-4607 | 6 | 1
|
||||
https://orcid.org/0009-0007-1385-3343 | 6 | 4
|
||||
https://orcid.org/0009-0007-4527-7926 | 6 | 1
|
||||
https://orcid.org/0009-0008-1549-0440 | 6 | 3
|
||||
https://orcid.org/0009-0008-3724-4603 | 6 | 2
|
||||
https://orcid.org/0009-0008-5380-3284 | 6 | 2
|
||||
https://orcid.org/0009-0009-3354-7794 | 6 | 1
|
||||
https://orcid.org/0009-0009-4284-8943 | 6 | 1
|
||||
https://orcid.org/0009-0009-6074-6238 | 6 | 3
|
||||
https://orcid.org/0009-0009-9522-8588 | 6 | 1
|
||||
https://orcid.org/0000-0001-5094-5879 | 5 | 4
|
||||
https://orcid.org/0000-0001-5124-7693 | 5 | 2
|
||||
https://orcid.org/0000-0001-5144-7900 | 5 | 5
|
||||
https://orcid.org/0000-0001-5552-5400 | 5 | 3
|
||||
https://orcid.org/0000-0001-5565-7868 | 5 | 3
|
||||
https://orcid.org/0000-0001-5646-0602 | 5 | 2
|
||||
https://orcid.org/0000-0001-5650-6770 | 5 | 1
|
||||
https://orcid.org/0000-0001-5881-4670 | 5 | 5
|
||||
https://orcid.org/0000-0001-5961-9033 | 5 | 2
|
||||
https://orcid.org/0000-0001-5979-6590 | 5 | 3
|
||||
https://orcid.org/0000-0001-5989-9338 | 5 | 3
|
||||
https://orcid.org/0000-0001-6153-3896 | 5 | 1
|
||||
https://orcid.org/0000-0001-6253-4313 | 5 | 3
|
||||
https://orcid.org/0000-0001-6278-9674 | 5 | 3
|
||||
https://orcid.org/0000-0001-6279-2267 | 5 | 5
|
||||
https://orcid.org/0000-0001-6326-4773 | 5 | 5
|
||||
https://orcid.org/0000-0001-6342-3471 | 5 | 4
|
||||
https://orcid.org/0000-0001-6453-0447 | 5 | 4
|
||||
https://orcid.org/0000-0001-6797-4000 | 5 | 5
|
||||
https://orcid.org/0000-0001-6828-9769 | 5 | 2
|
||||
https://orcid.org/0000-0001-6867-8166 | 5 | 2
|
||||
https://orcid.org/0000-0001-6930-4780 | 5 | 2
|
||||
https://orcid.org/0000-0001-6976-6256 | 5 | 1
|
||||
https://orcid.org/0000-0001-7256-6714 | 5 | 2
|
||||
https://orcid.org/0000-0001-7516-8850 | 5 | 2
|
||||
https://orcid.org/0000-0001-7759-1943 | 5 | 5
|
||||
https://orcid.org/0000-0001-7770-1102 | 5 | 5
|
||||
https://orcid.org/0000-0001-7896-8861 | 5 | 3
|
||||
https://orcid.org/0000-0001-8026-5380 | 5 | 4
|
||||
https://orcid.org/0000-0001-8049-5143 | 5 | 3
|
||||
https://orcid.org/0000-0001-8130-7423 | 5 | 4
|
||||
https://orcid.org/0000-0001-8140-4610 | 5 | 5
|
||||
https://orcid.org/0000-0001-8204-6157 | 5 | 2
|
||||
https://orcid.org/0000-0001-8292-7691 | 5 | 3
|
||||
https://orcid.org/0000-0001-8331-4854 | 5 | 1
|
||||
https://orcid.org/0000-0001-8367-8703 | 5 | 3
|
||||
https://orcid.org/0000-0001-8387-1853 | 5 | 3
|
||||
https://orcid.org/0000-0001-8415-6720 | 5 | 4
|
||||
https://orcid.org/0000-0001-8430-0446 | 5 | 4
|
||||
https://orcid.org/0000-0001-8463-0496 | 5 | 1
|
||||
https://orcid.org/0000-0001-8493-3737 | 5 | 1
|
||||
https://orcid.org/0000-0001-8647-7077 | 5 | 4
|
||||
https://orcid.org/0000-0001-8719-057X | 5 | 4
|
||||
https://orcid.org/0000-0001-8751-5944 | 5 | 2
|
||||
https://orcid.org/0000-0001-8785-847X | 5 | 3
|
||||
https://orcid.org/0000-0001-8791-7978 | 5 | 3
|
||||
https://orcid.org/0000-0001-8810-5971 | 5 | 4
|
||||
https://orcid.org/0000-0001-8828-3823 | 5 | 2
|
||||
https://orcid.org/0000-0001-8829-9681 | 5 | 2
|
||||
https://orcid.org/0000-0001-9012-395X | 5 | 2
|
||||
https://orcid.org/0000-0001-9031-6751 | 5 | 1
|
||||
https://orcid.org/0000-0001-9034-2925 | 5 | 2
|
||||
https://orcid.org/0000-0001-9048-4341 | 5 | 1
|
||||
https://orcid.org/0000-0001-9094-1493 | 5 | 3
|
||||
https://orcid.org/0000-0001-9301-2382 | 5 | 1
|
||||
https://orcid.org/0000-0001-9365-6452 | 5 | 4
|
||||
https://orcid.org/0000-0001-9440-5807 | 5 | 1
|
||||
https://orcid.org/0000-0001-9719-3563 | 5 | 5
|
||||
https://orcid.org/0000-0001-9734-574X | 5 | 3
|
||||
https://orcid.org/0000-0001-9861-2942 | 5 | 5
|
||||
https://orcid.org/0000-0002-0035-3821 | 5 | 2
|
||||
https://orcid.org/0000-0002-0044-6470 | 5 | 1
|
||||
https://orcid.org/0000-0002-0224-2869 | 5 | 2
|
||||
https://orcid.org/0000-0002-0286-5070 | 5 | 3
|
||||
https://orcid.org/0000-0002-0550-457X | 5 | 1
|
||||
https://orcid.org/0000-0002-0554-4627 | 5 | 3
|
||||
https://orcid.org/0000-0002-0608-065X | 5 | 5
|
||||
https://orcid.org/0000-0002-0653-0761 | 5 | 3
|
||||
https://orcid.org/0000-0002-0672-6895 | 5 | 1
|
||||
https://orcid.org/0000-0002-0804-9197 | 5 | 2
|
||||
https://orcid.org/0000-0002-0809-1897 | 5 | 3
|
||||
https://orcid.org/0000-0002-0870-8420 | 5 | 2
|
||||
https://orcid.org/0000-0002-0984-7887 | 5 | 5
|
||||
https://orcid.org/0000-0002-1034-1410 | 5 | 2
|
||||
https://orcid.org/0000-0002-1182-7869 | 5 | 3
|
||||
https://orcid.org/0000-0002-1303-0458 | 5 | 1
|
||||
https://orcid.org/0000-0002-1394-9907 | 5 | 4
|
||||
@@ -0,0 +1,53 @@
|
||||
Analyse 3: Die 50 Autoren mit den längsten display_names im gesamten Autoren-Index, absteigend nach Zeichenlänge sortiert.
|
||||
Display Name | Länge
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -----
|
||||
Martin Senftleben, Pernille Bruun Andersen, Lionel Bently, Michele Bertani, Robert Burrell, Mireille Buydens, Vincenzo Di Cataldo, Giovanni Cavani, Estelle Derclaye, Graeme Dinwoodie, Severine Dussollier, Dev S. Gangjee, Christophe Geiger, Gustavo Ghidini, Jonathan Griffiths, Henning Grosse Ruse-Khan, Paul can der Kooij, Annette Kur, Nari Lee, David Llewelyn, Luigi Mansani, Timo Minssen, Ansgar Ohly, Alexander Peukert, Marco Ricolfi, Ole-Andreas Rognstad, Thomas Ssmbuc, Paolo Spads, Marco Saverio Spolidoro, Jens Schovsbo, Paul Torremans, Luigi Carlo Ubertazzi, Adriano Vanzetti, D.W. Feer Verkade, Dirk Visser, Katja Weckström, Raquel Xalabarder, Lukasz Zelechowski | 671
|
||||
Based on the available search results, I have organized the top AI labs, government agencies, and research institutions into a categorized bullet-point list for you. This list includes major commercial vendors, independent non-profit research centers, and government bodies actively involved in AI development and regulation. 🧪 Top Private AI Labs & Companies Major Commercial Leaders (The "Front-runners") · Google (Google DeepMind): Recognized as a leader in Enterprise Agentic AI Platforms with | 500
|
||||
Kevin Eze University, Mgbowo, Enugu State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Kevin Eze University, Mgbowo, Enugu State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution for | 500
|
||||
Christopher University Mowe 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Christopher University Mowe 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Po | 500
|
||||
James Hope University, Lagos, Lagos State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., James Hope University, Lagos, Lagos State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution for | 500
|
||||
Capital City University, Kano State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Capital City University, Kano State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of | 500
|
||||
Nile University of Nigeria, Abuja 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Nile University of Nigeria, Abuja 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Cou | 500
|
||||
Lux Mundi University Umuahia, Abia State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Lux Mundi University Umuahia, Abia State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, | 500
|
||||
University of Fortune, Igbotako, Ondo State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., University of Fortune, Igbotako, Ondo State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution | 500
|
||||
Anan University, Kwall, Plateau State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Anan University, Kwall, Plateau State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Chang | 500
|
||||
Spiritan University, Nneochi Abia State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Spiritan University, Nneochi Abia State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, C | 500
|
||||
Hillside University of Science and Technology, Okemisi, Ekiti State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Hillside University of Science and Technology, Okemisi, Ekiti State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct- | 500
|
||||
JEFAP University, Suleja, Niger State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., JEFAP University, Suleja, Niger State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Chang | 500
|
||||
New City University, Ayetoro, Ogun State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., New City University, Ayetoro, Ogun State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, | 500
|
||||
Westland University Iwo, Osun State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Westland University Iwo, Osun State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of | 500
|
||||
Kings University, Ode Omu 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Kings University, Ode Omu 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post g | 500
|
||||
Augustine University 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Augustine University 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Di | 500
|
||||
Canadian University of Nigeria, Abuja 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Canadian University of Nigeria, Abuja 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Chang | 500
|
||||
Azione Verde University, Amaigbo, Imo State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Azione Verde University, Amaigbo, Imo State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution | 500
|
||||
European University of Nigeria, Duboyi, FCT 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., European University of Nigeria, Duboyi, FCT 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution | 500
|
||||
Sam Maris University, Ondo 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Sam Maris University, Ondo 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post | 500
|
||||
Gerar University of Medical Science Imope Ijebu, Ogun State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Gerar University of Medical Science Imope Ijebu, Ogun State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Tran | 500
|
||||
Huda University, Gusau, Zamafara State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Huda University, Gusau, Zamafara State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Cha | 500
|
||||
Tansian University, Umunya 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Tansian University, Umunya 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post | 500
|
||||
Rayhaan University, Kebbi 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Rayhaan University, Kebbi 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post g | 500
|
||||
Monarch University, Iyesi-Ota, Ogun State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Monarch University, Iyesi-Ota, Ogun State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution for | 500
|
||||
Vision University, Ikogbo, Ogun State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Vision University, Ikogbo, Ogun State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Chang | 500
|
||||
Legacy University, Okija Anambra State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Legacy University, Okija Anambra State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Cha | 500
|
||||
Micheal & Cecilia Ibru University 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Micheal & Cecilia Ibru University 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Cou | 500
|
||||
Ojaja University Eiyenkorin, Kwara State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Ojaja University Eiyenkorin, Kwara State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, | 500
|
||||
Eranova University, Abuja 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Eranova University, Abuja 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post g | 500
|
||||
Saisa University of Medical Sciences and Technology, Sokoto State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Saisa University of Medical Sciences and Technology, Sokoto State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entr | 500
|
||||
Elrazi Medical University Yargaya University, Kano State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Elrazi Medical University Yargaya University, Kano State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer F | 500
|
||||
Jewel University, Gombe state 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Jewel University, Gombe state 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form | 500
|
||||
Lighthouse University, Evbobanosa, Edo State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Lighthouse University, Evbobanosa, Edo State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of instituti | 500
|
||||
Mercy Medical University, Iwo, Ogun State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Mercy Medical University, Iwo, Ogun State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution for | 500
|
||||
Amadeus University, Amizi, Abia State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Amadeus University, Amizi, Abia State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Chang | 500
|
||||
African University of Economics, FCT, Abuja 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., African University of Economics, FCT, Abuja 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution | 500
|
||||
Western Delta University, Oghara Delta State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Western Delta University, Oghara Delta State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of instituti | 500
|
||||
Edusoko University, Bida, Niger State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Edusoko University, Bida, Niger State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Chang | 500
|
||||
Philomath University, Kuje, Abuja 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Philomath University, Kuje, Abuja 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Cou | 500
|
||||
Glorious Vision University, Ogwa, Edo State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Glorious Vision University, Ogwa, Edo State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution | 500
|
||||
Coal City University Enugu State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Coal City University Enugu State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Cours | 500
|
||||
Tazkiyah University, Kaduna, Kaduna State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Tazkiyah University, Kaduna, Kaduna State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution for | 500
|
||||
Peter University, Achina-Onneh Anambra State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Peter University, Achina-Onneh Anambra State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of instituti | 500
|
||||
Evangel University, Akaeze 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Evangel University, Akaeze 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post | 500
|
||||
Baba Ahmed University, Kano State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Baba Ahmed University, Kano State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Cou | 500
|
||||
Jimoh Babalola University, Ilorin, Kwara State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Jimoh Babalola University, Ilorin, Kwara State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of insti | 500
|
||||
Amaj University, Kwali, Abuja 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., Amaj University, Kwali, Abuja 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form | 500
|
||||
El-Amin University, Minna, Niger State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Change of Course form, Post graduate Diploma form, Masters form, Phd form call ☎️(+23408039478772) for more inquiry and admission assistance., El-Amin University, Minna, Niger State 2026/27 JUPEB/IJMB Form is out ☎️(08039478772) DR MERCY☎️ (+23408039478772) Direct-Entry Form, Transfer Form, Change of institution form, Cha | 500
|
||||
@@ -0,0 +1,44 @@
|
||||
Analyse 4: Vollständiger Scan über den gesamten Autoren-Index — für jeden Autor mit einem Emoji im display_name eine Zeile je gefundenem Emoji (deckt die gängigen Emoji-Unicode-Blöcke ab, nicht zu 100% vollständig). Anzahl der Einträge ist die echte Gesamtzahl, pro Emoji werden aber nur 5 Beispiel-Autoren angezeigt.
|
||||
Emoji | Anzahl der Einträge | OpenAlexID des Authors
|
||||
----- | ------------------- | ----------------------
|
||||
☎ | 309 | A5122404034
|
||||
☎ | 309 | A5122409605
|
||||
☎ | 309 | A5122413004
|
||||
☎ | 309 | A5122413783
|
||||
☎ | 309 | A5122423823
|
||||
🌠 | 9 | A5130251152
|
||||
🌠 | 9 | A5130293752
|
||||
🌠 | 9 | A5130321119
|
||||
🌠 | 9 | A5130409395
|
||||
🌠 | 9 | A5130539169
|
||||
✓ | 8 | A5125699161
|
||||
✓ | 8 | A5125699643
|
||||
✓ | 8 | A5125709226
|
||||
✓ | 8 | A5125709340
|
||||
✓ | 8 | A5125733201
|
||||
🜇 | 3 | A5127964094
|
||||
🜇 | 3 | A5128305757
|
||||
🜇 | 3 | A5130005920
|
||||
✩ | 2 | A5125693674
|
||||
✩ | 2 | A5125697963
|
||||
🌍 | 2 | A5124304447
|
||||
🌍 | 2 | A5126049861
|
||||
🥇 | 2 | A5125367570
|
||||
🥇 | 2 | A5125593574
|
||||
☮ | 1 | A5123428025
|
||||
⚶ | 1 | A5126577509
|
||||
⛑ | 1 | A5126571570
|
||||
⛔ | 1 | A5126049861
|
||||
✀ | 1 | A5121072233
|
||||
✦ | 1 | A5121259916
|
||||
✨ | 1 | A5124304447
|
||||
⬡ | 1 | A5028861871
|
||||
⭥ | 1 | A5003445970
|
||||
⮋ | 1 | A5096960654
|
||||
🇪 | 1 | A5125031720
|
||||
🇺 | 1 | A5125031720
|
||||
🌀 | 1 | A5126577509
|
||||
🌱 | 1 | A5124304447
|
||||
🐳 | 1 | A5129532556
|
||||
🦇 | 1 | A5127891150
|
||||
🧪 | 1 | A5130442535
|
||||
@@ -0,0 +1,503 @@
|
||||
Analyse 5: Count-by auf display_name — wie viele Autoren-Dokumente denselben display_name (exakter Match) teilen.
|
||||
Display Name | Anzahl
|
||||
--------------------------- | ------
|
||||
Y. Wang | 7217
|
||||
Y. Zhang | 6915
|
||||
Z Weng | 6667
|
||||
J. Wang | 6653
|
||||
J. Zhang | 5862
|
||||
Y. Liu | 5565
|
||||
Y. Li | 5166
|
||||
J. Li | 4966
|
||||
X. Wang | 4869
|
||||
K. Cenzual | 4603
|
||||
Y. Chen | 4599
|
||||
H. Wang | 4565
|
||||
T. Carlyle | 4495
|
||||
L. Zhang | 4485
|
||||
X. Zhang | 4300
|
||||
J. Lee | 4185
|
||||
L. Wang | 4167
|
||||
X. Li | 3999
|
||||
Y Wang | 3989
|
||||
J. Chen | 3981
|
||||
J. Liu | 3858
|
||||
Z. Wang | 3858
|
||||
H. Zhang | 3833
|
||||
O. Shcherban | 3753
|
||||
V. Dubenskyy | 3749
|
||||
Y Zhang | 3594
|
||||
H. Li | 3580
|
||||
N. Vogt | 3542
|
||||
J. Kim | 3498
|
||||
K. Kuchitsu | 3489
|
||||
Ken Auberry | 3458
|
||||
MISSING-VALUE MISSING-VALUE | 3430
|
||||
X. Liu | 3386
|
||||
S. Lee | 3353
|
||||
X. Chen | 3192
|
||||
W. Li | 3157
|
||||
S. Wang | 3128
|
||||
T. Iijima | 3105
|
||||
L. Li | 3079
|
||||
Z. Zhang | 2957
|
||||
W. Wang | 2919
|
||||
C. Wang | 2891
|
||||
J Wang | 2809
|
||||
P. Villars | 2762
|
||||
H. Liu | 2757
|
||||
S. Kim | 2727
|
||||
H. Kim | 2638
|
||||
H.V. Kehiaian | 2578
|
||||
Wei Wang | 2577
|
||||
Yang Liu | 2566
|
||||
J Zhang | 2563
|
||||
L Wang | 2557
|
||||
C. Chen | 2554
|
||||
Wei Zhang | 2510
|
||||
Z. Li | 2499
|
||||
L Zhang | 2492
|
||||
C. Li | 2486
|
||||
Z. Wagner | 2480
|
||||
J. Linek | 2473
|
||||
R. Gladyshevskii | 2469
|
||||
L. Chen | 2449
|
||||
S. Chen | 2443
|
||||
I. Wichterle | 2437
|
||||
H. Chen | 2392
|
||||
X Wang | 2371
|
||||
I. Savysyuk | 2363
|
||||
Z. Liu | 2344
|
||||
W. Zhang | 2305
|
||||
Y. Kim | 2244
|
||||
P. Wang | 2227
|
||||
Y Chen | 2219
|
||||
B Graveley | 2202
|
||||
Yu Zhang | 2173
|
||||
S. Li | 2137
|
||||
L. Liu | 2135
|
||||
X Zhang | 2122
|
||||
G. Chen | 2121
|
||||
C. Liu | 2112
|
||||
M. Wang | 2104
|
||||
Wei Li | 2077
|
||||
D. Wang | 2053
|
||||
Q. Wang | 2040
|
||||
Xin Wang | 2009
|
||||
H. Lee | 2003
|
||||
S. Zhang | 1972
|
||||
H. V. Kehiaian | 1944
|
||||
H Wang | 1917
|
||||
J Chen | 1913
|
||||
Jing Li | 1911
|
||||
Q. Zhang | 1907
|
||||
F. Wang | 1856
|
||||
Z. Chen | 1839
|
||||
N A | 1834
|
||||
Lei Wang | 1826
|
||||
S. Liu | 1825
|
||||
G. Li | 1812
|
||||
Yang Li | 1785
|
||||
G. F. R. B. | 1783
|
||||
J. Daams | 1781
|
||||
W. Chen | 1779
|
||||
B. Wang | 1768
|
||||
Lei Zhang | 1726
|
||||
M. Chen | 1719
|
||||
Yu Wang | 1718
|
||||
Wei Liu | 1708
|
||||
Jing Wang | 1702
|
||||
W. Liu | 1702
|
||||
C. Zhang | 1697
|
||||
C.P. Khare | 1683
|
||||
J. Park | 1683
|
||||
K. Wang | 1678
|
||||
Q. Liu | 1676
|
||||
G. Wang | 1663
|
||||
O. Pavlyuk | 1650
|
||||
Q. Li | 1642
|
||||
T. Wang | 1636
|
||||
Yan Wang | 1635
|
||||
Z Wang | 1632
|
||||
Y Li | 1611
|
||||
Ying Wang | 1611
|
||||
H Zhang | 1604
|
||||
B. Liu | 1602
|
||||
E. Hirota | 1593
|
||||
Yan Li | 1589
|
||||
K. Lee | 1562
|
||||
L. H. Michael | 1561
|
||||
Yan Zhang | 1561
|
||||
Yang Yang | 1558
|
||||
K. Lucia | 1556
|
||||
B. Li | 1548
|
||||
M. Li | 1533
|
||||
M. Zhang | 1525
|
||||
C. | 1503
|
||||
Jing Zhang | 1498
|
||||
S. Park | 1476
|
||||
M. Jain | 1475
|
||||
L Chen | 1470
|
||||
Hao Zhang | 1468
|
||||
D. Liu | 1466
|
||||
Xin Li | 1466
|
||||
P. Pardasani | 1464
|
||||
J.-C. Fontaine | 1462
|
||||
Li Li | 1455
|
||||
F. Liu | 1452
|
||||
C. Lee | 1447
|
||||
B. Cornils | 1441
|
||||
Feng Wang | 1429
|
||||
W. C. B. | 1422
|
||||
F. Li | 1421
|
||||
J Li | 1421
|
||||
T. Liu | 1419
|
||||
H. Park | 1408
|
||||
USM ADMIN | 1403
|
||||
K. Kim | 1388
|
||||
Rui Wang | 1379
|
||||
D. Kim | 1375
|
||||
X Chen | 1375
|
||||
Hao Wang | 1368
|
||||
F. Zhang | 1355
|
||||
Z Zhang | 1354
|
||||
J.H. Kim | 1352
|
||||
Yi Zhang | 1352
|
||||
D. Li | 1351
|
||||
Y Liu | 1345
|
||||
B. Zhang | 1320
|
||||
R. Wang | 1316
|
||||
Li Zhang | 1306
|
||||
M. Lee | 1303
|
||||
D. Lee | 1298
|
||||
Jie Li | 1293
|
||||
N. Nakamura | 1285
|
||||
Wei Chen | 1285
|
||||
Jie Zhang | 1284
|
||||
Tao Wang | 1281
|
||||
D. Zhang | 1272
|
||||
M. Liu | 1266
|
||||
Jun Zhang | 1254
|
||||
S Wang | 1252
|
||||
Yu Liu | 1252
|
||||
H Chen | 1243
|
||||
Xiang Li | 1242
|
||||
Li Wang | 1235
|
||||
Jun Wang | 1233
|
||||
C. C. B. | 1232
|
||||
Xin Zhang | 1228
|
||||
A. Chen | 1227
|
||||
W Wang | 1224
|
||||
Gottfried Nitze | 1222
|
||||
Peng Zhang | 1217
|
||||
Hui Wang | 1212
|
||||
P. Zhang | 1212
|
||||
C Wang | 1207
|
||||
T. Zhang | 1199
|
||||
L Li | 1189
|
||||
Ying Zhang | 1187
|
||||
W Zhang | 1175
|
||||
Chang Liu | 1173
|
||||
Hui Zhang | 1167
|
||||
R. Zhang | 1167
|
||||
H. Chihara | 1162
|
||||
Hui Li | 1157
|
||||
J. H. Kim | 1157
|
||||
Jun Li | 1156
|
||||
Yi Wang | 1152
|
||||
Rui Zhang | 1150
|
||||
Yang Wang | 1145
|
||||
Q Wang | 1144
|
||||
M. | 1143
|
||||
R.H.O. | 1132
|
||||
Jian Zhang | 1131
|
||||
J. H. Duffus | 1121
|
||||
Bo Wang | 1117
|
||||
Chao Wang | 1117
|
||||
Xin Liu | 1116
|
||||
Yan Liu | 1115
|
||||
편집실 | 1115
|
||||
Qi Wang | 1112
|
||||
Fan Yang | 1100
|
||||
D. A. Ramsay | 1094
|
||||
Qi Zhang | 1093
|
||||
Yang Zhang | 1091
|
||||
Peng Wang | 1090
|
||||
T. Li | 1087
|
||||
Jian Wang | 1085
|
||||
M. Kim | 1084
|
||||
Y. Lee | 1084
|
||||
G. Zhang | 1080
|
||||
Q Zhang | 1080
|
||||
Tao Zhang | 1069
|
||||
D. Chen | 1068
|
||||
J. Castañer | 1066
|
||||
J.H. Lee | 1065
|
||||
G. Liu | 1059
|
||||
J. Vogt | 1059
|
||||
J Liu | 1058
|
||||
P. Chen | 1055
|
||||
Qian Wang | 1052
|
||||
X Li | 1043
|
||||
S. H. Kim | 1039
|
||||
Ming Li | 1036
|
||||
Ying Li | 1031
|
||||
R. Andrew Chambers | 1027
|
||||
Chen Wang | 1013
|
||||
S Chen | 1009
|
||||
Yi Liu | 1005
|
||||
Ying Liu | 1002
|
||||
K. M. REESE | 997
|
||||
Bin Wang | 996
|
||||
K. Liu | 996
|
||||
Jie Liu | 995
|
||||
B. Fischer | 986
|
||||
Xi Chen | 986
|
||||
B. Predel | 985
|
||||
C. Kim | 978
|
||||
J. H. Lee | 972
|
||||
Hao Chen | 970
|
||||
K. Zhang | 968
|
||||
Hao Li | 964
|
||||
Z Chen | 960
|
||||
S Zhang | 958
|
||||
S. | 956
|
||||
K. Li | 955
|
||||
Q. Chen | 955
|
||||
Chen Chen | 954
|
||||
Yue Wang | 952
|
||||
B. | 948
|
||||
Lei Li | 947
|
||||
D Wang | 945
|
||||
Yu Chen | 940
|
||||
Bo Li | 937
|
||||
B. Chen | 927
|
||||
Jing Liu | 927
|
||||
D. Siobhan | 920
|
||||
Jie Wang | 916
|
||||
P. Liu | 911
|
||||
Yue Zhang | 910
|
||||
Jie Chen | 903
|
||||
Lin Li | 903
|
||||
H Li | 896
|
||||
M Wang | 896
|
||||
R. H. De Rijk | 892
|
||||
C Chen | 889
|
||||
B Wang | 887
|
||||
Kai Wang | 885
|
||||
L. Hnědkovský | 881
|
||||
K. Cho | 880
|
||||
Meng Wang | 879
|
||||
Bo Zhang | 877
|
||||
C. Hartwich | 877
|
||||
Qian Zhang | 874
|
||||
Rui Li | 870
|
||||
Yi Li | 868
|
||||
Fei Wang | 866
|
||||
Xin Chen | 865
|
||||
Jun Liu | 863
|
||||
G.F.S. | 862
|
||||
T. Chen | 862
|
||||
G. B. M. Zerr | 861
|
||||
Yong Wang | 860
|
||||
Chao Zhang | 856
|
||||
T. Lee | 854
|
||||
V. Kuprysyuk | 853
|
||||
Fan Zhang | 850
|
||||
S.H. Lee | 848
|
||||
W Chen | 848
|
||||
Hao Wu | 840
|
||||
S.H. Kim | 839
|
||||
Qiang Li | 834
|
||||
R. T. H. | 834
|
||||
Peng Liu | 833
|
||||
Jian Li | 832
|
||||
Yong Li | 828
|
||||
Yang Chen | 827
|
||||
B. Lee | 825
|
||||
F. C. H. | 824
|
||||
H.J. Kim | 824
|
||||
K. Chen | 824
|
||||
H. S. Kim | 823
|
||||
D. H. Kim | 820
|
||||
Qi Li | 820
|
||||
R. Lee | 819
|
||||
M. Patricia Juárez | 818
|
||||
X Liu | 811
|
||||
Xu Wang | 811
|
||||
Jing Chen | 810
|
||||
Jing Yang | 808
|
||||
M. Green | 808
|
||||
S. H. Lee | 805
|
||||
Bin Li | 802
|
||||
Bo Liu | 801
|
||||
Min Zhang | 801
|
||||
Lei Chen | 800
|
||||
J Lee | 799
|
||||
Lin Wang | 799
|
||||
Yi Yang | 798
|
||||
Peng Li | 796
|
||||
W. | 795
|
||||
W. Kim | 794
|
||||
W. Lee | 794
|
||||
Qi Liu | 793
|
||||
Hao Liu | 792
|
||||
Zhen Wang | 792
|
||||
Tao Li | 790
|
||||
Na Li | 787
|
||||
H. S. Chen | 785
|
||||
Bin Liu | 783
|
||||
P. Li | 780
|
||||
Yong Zhang | 779
|
||||
A. Lee | 778
|
||||
Hui Liu | 778
|
||||
Min Li | 778
|
||||
Jie Yang | 777
|
||||
J.S. Kim | 776
|
||||
M Zhang | 770
|
||||
Chao Li | 769
|
||||
S Lee | 769
|
||||
Wei Wei | 769
|
||||
E. Lee | 767
|
||||
B Zhang | 766
|
||||
Meng Li | 766
|
||||
F. Chen | 762
|
||||
R. Li | 761
|
||||
Tao Liu | 756
|
||||
R. Gupta | 752
|
||||
Gang Wang | 751
|
||||
Yang Yu | 750
|
||||
Lei Liu | 749
|
||||
Yuan Li | 749
|
||||
Lu Wang | 747
|
||||
A. Burg | 746
|
||||
Zhen Zhang | 744
|
||||
Xu Zhang | 743
|
||||
R. Chen | 742
|
||||
Wei Xu | 742
|
||||
A. Richard Green | 737
|
||||
C Zhang | 737
|
||||
Li Liu | 737
|
||||
Qian Li | 737
|
||||
J. Green | 735
|
||||
Wei Huang | 735
|
||||
Lin Zhang | 733
|
||||
Kai Zhang | 732
|
||||
Jun Yang | 731
|
||||
K. Park | 731
|
||||
Yan Chen | 731
|
||||
Wei Zhou | 728
|
||||
Yu Li | 726
|
||||
Ning Li | 724
|
||||
R. Liu | 718
|
||||
Wei Wu | 718
|
||||
F Wang | 716
|
||||
C. Park | 715
|
||||
Chi Zhang | 712
|
||||
O. Crosby | 712
|
||||
P. P. | 712
|
||||
Qiang Wang | 712
|
||||
R. Zaremba | 712
|
||||
Wei Zhao | 712
|
||||
T. Kim | 710
|
||||
R. | 709
|
||||
Dong Wang | 708
|
||||
Lu Zhang | 707
|
||||
Z Li | 701
|
||||
L. | 699
|
||||
G. Kraatz | 695
|
||||
J. M. Synge | 695
|
||||
Ying Chen | 694
|
||||
G Wang | 690
|
||||
Lei Yang | 690
|
||||
E. S. Krafsur | 689
|
||||
Wei Yang | 689
|
||||
B. Kim | 687
|
||||
L. L. K. | 687
|
||||
拓二 安達 | 687
|
||||
D. Simon | 686
|
||||
Feng Liu | 686
|
||||
C. Mai | 685
|
||||
K. K. Verma | 685
|
||||
S. Harvey Mudd | 685
|
||||
Chen Li | 684
|
||||
G Chen | 682
|
||||
Feng Li | 680
|
||||
D. Y.-M. | 679
|
||||
Liang Chen | 676
|
||||
H. J. Kim | 675
|
||||
Qiang Zhang | 675
|
||||
Wei Sun | 674
|
||||
Chao Liu | 672
|
||||
Jing Xu | 668
|
||||
Yue Li | 667
|
||||
C.J. Wormald | 665
|
||||
Li Chen | 664
|
||||
D. Green | 663
|
||||
G. | 662
|
||||
H.S. Kim | 662
|
||||
Li Yang | 662
|
||||
Bin Zhang | 661
|
||||
Shuai Wang | 661
|
||||
J.S. Lee | 659
|
||||
Jin Wang | 659
|
||||
N. Li | 659
|
||||
Gang Li | 658
|
||||
J Kim | 658
|
||||
Li Na | 658
|
||||
Lin Chen | 658
|
||||
J.-P.E. Grolier | 657
|
||||
Hong Zhang | 656
|
||||
P. Lee | 655
|
||||
Jing Zhao | 654
|
||||
Yong Liu | 653
|
||||
A. Wang | 652
|
||||
C. Sloby | 651
|
||||
H. B. | 649
|
||||
D. W. E. Green | 646
|
||||
P Wang | 645
|
||||
淳 久保田 | 645
|
||||
J. M. | 643
|
||||
Bo Yang | 642
|
||||
H. | 642
|
||||
J. Alexandre | 642
|
||||
Ning Wang | 642
|
||||
H Liu | 640
|
||||
Amit Kumar | 639
|
||||
Ting Wang | 639
|
||||
M. Rouprêt | 638
|
||||
Yuan Wang | 638
|
||||
D. | 637
|
||||
O Editor | 636
|
||||
P. Syamasundar Rao | 636
|
||||
J. S. Kim | 635
|
||||
K Wang | 635
|
||||
M Chen | 635
|
||||
C. H. Wang | 634
|
||||
S Li | 634
|
||||
Zhen Li | 634
|
||||
Min Wang | 633
|
||||
T Wang | 633
|
||||
Jia Liu | 632
|
||||
Ping Wang | 631
|
||||
Xiao Wang | 630
|
||||
J.S.H. | 628
|
||||
Nan Wang | 628
|
||||
Hui Chen | 624
|
||||
N. Wang | 624
|
||||
Zheng Li | 622
|
||||
Di Wu | 620
|
||||
Ping Li | 618
|
||||
Kai Li | 615
|
||||
Ke Wang | 615
|
||||
Jian Liu | 614
|
||||
D Zhang | 613
|
||||
Feng Zhang | 613
|
||||
A. Balian | 612
|
||||
P. Muller | 612
|
||||
Zheng Wang | 611
|
||||
Jun Chen | 609
|
||||
Tao Chen | 608
|
||||
Dan Li | 607
|
||||
X. Y. Zhang | 606
|
||||
J. H. | 604
|
||||
@@ -0,0 +1,14 @@
|
||||
Filter: nur Institution I62318514 (inkl. Unter-Einheiten)
|
||||
|
||||
Analyse 8: Autoren mit works_count >= 50, aber cited_by_count <= 5. (mögliche 'Placeholder' Authoren)
|
||||
OpenAlexID | Works Count | Cited By Count
|
||||
----------- | ----------- | --------------
|
||||
A5127000715 | 362 | 0
|
||||
A5125181253 | 271 | 2
|
||||
A5094302919 | 215 | 3
|
||||
A5080822544 | 73 | 3
|
||||
A5061785934 | 60 | 1
|
||||
A5127339696 | 55 | 0
|
||||
A5127463379 | 55 | 0
|
||||
A5023622635 | 54 | 1
|
||||
A5100558242 | 50 | 0
|
||||
@@ -0,0 +1,603 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import re
|
||||
import sys
|
||||
from collections import Counter
|
||||
from datetime import date, datetime
|
||||
from pathlib import Path
|
||||
|
||||
import requests
|
||||
|
||||
def search(
|
||||
query: dict,
|
||||
aggs: dict | None = None,
|
||||
size: int = 0,
|
||||
sort: list | None = None,
|
||||
source: list | None = None,
|
||||
search_after: list | None = None,
|
||||
) -> dict:
|
||||
body = {"size": size, "query": query}
|
||||
if aggs is not None:
|
||||
body["aggs"] = aggs
|
||||
if sort is not None:
|
||||
body["sort"] = sort
|
||||
if source is not None:
|
||||
body["_source"] = source
|
||||
if search_after is not None:
|
||||
body["search_after"] = search_after
|
||||
|
||||
response = requests.post(
|
||||
f"https://project.nes.uni-due.de/elastic/openalex-authors/_search",
|
||||
headers={
|
||||
"Authorization": f"ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ",
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
json=body,
|
||||
timeout=60,
|
||||
)
|
||||
|
||||
response.raise_for_status()
|
||||
|
||||
return response.json()
|
||||
|
||||
|
||||
def institution_filter(institution_id: str | None) -> dict | None:
|
||||
|
||||
if not institution_id:
|
||||
return None
|
||||
|
||||
full_id = (
|
||||
institution_id
|
||||
if institution_id.startswith("http")
|
||||
else f"https://openalex.org/{institution_id}"
|
||||
)
|
||||
|
||||
return {
|
||||
"nested": {
|
||||
"path": "affiliations",
|
||||
"query": {
|
||||
"term": {"affiliations.institution.lineage": full_id},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def with_institution_filter(base_query: dict, institution_id: str | None) -> dict:
|
||||
inst_filter = institution_filter(institution_id)
|
||||
if inst_filter is None:
|
||||
return base_query
|
||||
return {"bool": {"filter": [base_query, inst_filter]}}
|
||||
|
||||
|
||||
def fetch_analysis_1_data(institution_id: str | None = None) -> list[dict]:
|
||||
|
||||
result = search(
|
||||
query=with_institution_filter({"exists": {"field": "orcid"}}, institution_id),
|
||||
aggs={
|
||||
"by_orcid": {
|
||||
"terms": {
|
||||
"field": "orcid",
|
||||
"size": 500,
|
||||
"min_doc_count": 2,
|
||||
},
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
buckets = result["aggregations"]["by_orcid"]["buckets"]
|
||||
|
||||
return [
|
||||
{"orcid": bucket["key"], "author_count": bucket["doc_count"]}
|
||||
for bucket in buckets
|
||||
]
|
||||
|
||||
|
||||
def fetch_analysis_2_data(institution_id: str | None = None) -> list[dict]:
|
||||
|
||||
result = search(
|
||||
query=with_institution_filter({"exists": {"field": "orcid"}}, institution_id),
|
||||
aggs={
|
||||
"by_orcid": {
|
||||
"terms": {
|
||||
"field": "orcid",
|
||||
"size": 500,
|
||||
"min_doc_count": 2,
|
||||
},
|
||||
"aggs": {
|
||||
"unique_names": {
|
||||
"cardinality": {"field": "display_name.keyword"},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
buckets = result["aggregations"]["by_orcid"]["buckets"]
|
||||
|
||||
return [
|
||||
{
|
||||
"orcid": bucket["key"],
|
||||
"author_count": bucket["doc_count"],
|
||||
"unique_names": bucket["unique_names"]["value"],
|
||||
}
|
||||
for bucket in buckets
|
||||
]
|
||||
|
||||
|
||||
def fetch_analysis_3_data(limit: int = 50, institution_id: str | None = None) -> list[dict]:
|
||||
|
||||
result = search(
|
||||
query=with_institution_filter(
|
||||
{"exists": {"field": "display_name"}}, institution_id
|
||||
),
|
||||
size=limit,
|
||||
sort=[
|
||||
{
|
||||
"_script": {
|
||||
"type": "number",
|
||||
"script": {
|
||||
"lang": "painless",
|
||||
"source": "doc['display_name.keyword'].value.length()",
|
||||
},
|
||||
"order": "desc",
|
||||
},
|
||||
},
|
||||
],
|
||||
source=["display_name"],
|
||||
)
|
||||
|
||||
hits = result["hits"]["hits"]
|
||||
|
||||
return [
|
||||
{
|
||||
"display_name": hit["_source"]["display_name"],
|
||||
"length": len(hit["_source"]["display_name"]),
|
||||
}
|
||||
for hit in hits
|
||||
]
|
||||
|
||||
|
||||
def fetch_analysis_4_data(institution_id: str | None = None) -> list[dict]:
|
||||
|
||||
emoji_ranges = "☀-➿⬀-⯿\U0001F000-\U0001FFFF"
|
||||
pattern = f".*[{emoji_ranges}].*"
|
||||
emoji_pattern = re.compile(f"[{emoji_ranges}]")
|
||||
|
||||
query = with_institution_filter(
|
||||
{"regexp": {"display_name.keyword": {"value": pattern}}}, institution_id
|
||||
)
|
||||
sort = [{"id": "asc"}]
|
||||
page_size = 1000
|
||||
|
||||
rows = []
|
||||
search_after = None
|
||||
|
||||
while True:
|
||||
result = search(
|
||||
query=query,
|
||||
size=page_size,
|
||||
sort=sort,
|
||||
source=["id", "display_name"],
|
||||
search_after=search_after,
|
||||
)
|
||||
|
||||
hits = result["hits"]["hits"]
|
||||
if not hits:
|
||||
break
|
||||
|
||||
for hit in hits:
|
||||
author_id = hit["_source"]["id"].rsplit("/", 1)[-1]
|
||||
display_name = hit["_source"]["display_name"]
|
||||
for emoji in set(emoji_pattern.findall(display_name)):
|
||||
rows.append({"emoji": emoji, "author_id": author_id})
|
||||
|
||||
if len(hits) < page_size:
|
||||
break
|
||||
search_after = hits[-1]["sort"]
|
||||
|
||||
return rows
|
||||
|
||||
|
||||
def fetch_analysis_5_data(institution_id: str | None = None) -> list[dict]:
|
||||
|
||||
result = search(
|
||||
query=with_institution_filter(
|
||||
{"exists": {"field": "display_name"}}, institution_id
|
||||
),
|
||||
aggs={
|
||||
"by_display_name": {
|
||||
"terms": {
|
||||
"field": "display_name.keyword",
|
||||
"size": 500,
|
||||
"min_doc_count": 2,
|
||||
},
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
buckets = result["aggregations"]["by_display_name"]["buckets"]
|
||||
|
||||
return [
|
||||
{"display_name": bucket["key"], "author_count": bucket["doc_count"]}
|
||||
for bucket in buckets
|
||||
]
|
||||
|
||||
|
||||
def fetch_analysis_6_data(
|
||||
min_span: int = 80, institution_id: str | None = None
|
||||
) -> list[dict]:
|
||||
|
||||
query = with_institution_filter({"match_all": {}}, institution_id)
|
||||
sort = [{"id": "asc"}]
|
||||
page_size = 1000
|
||||
|
||||
rows = []
|
||||
search_after = None
|
||||
|
||||
while True:
|
||||
result = search(
|
||||
query=query,
|
||||
size=page_size,
|
||||
sort=sort,
|
||||
source=["id", "counts_by_year"],
|
||||
search_after=search_after,
|
||||
)
|
||||
|
||||
hits = result["hits"]["hits"]
|
||||
if not hits:
|
||||
break
|
||||
|
||||
for hit in hits:
|
||||
years = [
|
||||
entry["year"]
|
||||
for entry in hit["_source"].get("counts_by_year", [])
|
||||
if "year" in entry
|
||||
]
|
||||
if not years:
|
||||
continue
|
||||
|
||||
from_year = min(years)
|
||||
to_year = max(years)
|
||||
span = to_year - from_year
|
||||
|
||||
if span > min_span:
|
||||
rows.append(
|
||||
{
|
||||
"author_id": hit["_source"]["id"].rsplit("/", 1)[-1],
|
||||
"from_year": from_year,
|
||||
"to_year": to_year,
|
||||
"span": span,
|
||||
}
|
||||
)
|
||||
|
||||
if len(hits) < page_size:
|
||||
break
|
||||
search_after = hits[-1]["sort"]
|
||||
|
||||
return rows
|
||||
|
||||
|
||||
def fetch_analysis_7_data(institution_id: str | None = None) -> list[dict]:
|
||||
|
||||
current_year = date.today().year
|
||||
|
||||
query = with_institution_filter({"match_all": {}}, institution_id)
|
||||
sort = [{"id": "asc"}]
|
||||
page_size = 1000
|
||||
|
||||
rows = []
|
||||
search_after = None
|
||||
|
||||
while True:
|
||||
result = search(
|
||||
query=query,
|
||||
size=page_size,
|
||||
sort=sort,
|
||||
source=["id", "counts_by_year"],
|
||||
search_after=search_after,
|
||||
)
|
||||
|
||||
hits = result["hits"]["hits"]
|
||||
if not hits:
|
||||
break
|
||||
|
||||
for hit in hits:
|
||||
author_id = hit["_source"]["id"].rsplit("/", 1)[-1]
|
||||
for entry in hit["_source"].get("counts_by_year", []):
|
||||
year = entry.get("year")
|
||||
if year is not None and year > current_year:
|
||||
rows.append({"author_id": author_id, "year": year})
|
||||
|
||||
if len(hits) < page_size:
|
||||
break
|
||||
search_after = hits[-1]["sort"]
|
||||
|
||||
return rows
|
||||
|
||||
|
||||
def fetch_analysis_8_data(
|
||||
min_works: int = 50, max_citations: int = 5, institution_id: str | None = None
|
||||
) -> list[dict]:
|
||||
|
||||
query = with_institution_filter(
|
||||
{
|
||||
"bool": {
|
||||
"filter": [
|
||||
{"range": {"works_count": {"gte": min_works}}},
|
||||
{"range": {"cited_by_count": {"lte": max_citations}}},
|
||||
],
|
||||
},
|
||||
},
|
||||
institution_id,
|
||||
)
|
||||
sort = [{"id": "asc"}]
|
||||
page_size = 1000
|
||||
|
||||
rows = []
|
||||
search_after = None
|
||||
|
||||
while True:
|
||||
result = search(
|
||||
query=query,
|
||||
size=page_size,
|
||||
sort=sort,
|
||||
source=["id", "works_count", "cited_by_count"],
|
||||
search_after=search_after,
|
||||
)
|
||||
|
||||
hits = result["hits"]["hits"]
|
||||
if not hits:
|
||||
break
|
||||
|
||||
for hit in hits:
|
||||
source = hit["_source"]
|
||||
rows.append(
|
||||
{
|
||||
"author_id": source["id"].rsplit("/", 1)[-1],
|
||||
"works_count": source["works_count"],
|
||||
"cited_by_count": source["cited_by_count"],
|
||||
}
|
||||
)
|
||||
|
||||
if len(hits) < page_size:
|
||||
break
|
||||
search_after = hits[-1]["sort"]
|
||||
|
||||
return rows
|
||||
|
||||
|
||||
def print_table(headers: list[str], rows: list[list[str]]) -> None:
|
||||
widths = [
|
||||
max(len(str(cell)) for cell in [header, *(row[i] for row in rows)])
|
||||
for i, header in enumerate(headers)
|
||||
]
|
||||
|
||||
def print_row(cells: list[str]) -> None:
|
||||
print(" | ".join(str(cell).ljust(width) for cell, width in zip(cells, widths)))
|
||||
|
||||
print_row(headers)
|
||||
print_row(["-" * width for width in widths])
|
||||
for row in rows:
|
||||
print_row(row)
|
||||
|
||||
|
||||
def run_analysis_1(institution_id: str | None = None) -> None:
|
||||
print("Analyse 1: ORCIDs, die von 2 oder mehr Autoren-Dokumenten geteilt werden.")
|
||||
analysis_1_data = fetch_analysis_1_data(institution_id)
|
||||
analysis_1_data.sort(key=lambda group: group["author_count"], reverse=True)
|
||||
print_table(
|
||||
["ORCID", "Anzahl Autoren"],
|
||||
[[group["orcid"], group["author_count"]] for group in analysis_1_data],
|
||||
)
|
||||
|
||||
|
||||
def run_analysis_2(institution_id: str | None = None) -> None:
|
||||
print(
|
||||
"Analyse 2: Wie Analyse 1, zusätzlich mit der Anzahl unterschiedlicher "
|
||||
"display_names je ORCID (exakter Match) — trennt echte Namens-Duplikate "
|
||||
"von unterschiedlich benannten Autoren mit derselben ORCID."
|
||||
)
|
||||
analysis_2_data = fetch_analysis_2_data(institution_id)
|
||||
analysis_2_data.sort(key=lambda group: group["author_count"], reverse=True)
|
||||
print_table(
|
||||
["ORCID", "Gesamt", "Unique Names"],
|
||||
[
|
||||
[group["orcid"], group["author_count"], group["unique_names"]]
|
||||
for group in analysis_2_data
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
def run_analysis_3(institution_id: str | None = None) -> None:
|
||||
print(
|
||||
"Analyse 3: Die 50 Autoren mit den längsten display_names im gesamten "
|
||||
"Autoren-Index, absteigend nach Zeichenlänge sortiert."
|
||||
)
|
||||
analysis_3_data = fetch_analysis_3_data(limit=50, institution_id=institution_id)
|
||||
analysis_3_data.sort(key=lambda entry: entry["length"], reverse=True)
|
||||
print_table(
|
||||
["Display Name", "Länge"],
|
||||
[[entry["display_name"], entry["length"]] for entry in analysis_3_data],
|
||||
)
|
||||
|
||||
|
||||
def run_analysis_4(institution_id: str | None = None) -> None:
|
||||
max_examples_per_emoji = 5
|
||||
print(
|
||||
"Analyse 4: Vollständiger Scan über den gesamten Autoren-Index — für "
|
||||
"jeden Autor mit einem Emoji im display_name eine Zeile je gefundenem "
|
||||
"Emoji (deckt die gängigen Emoji-Unicode-Blöcke ab, nicht zu 100% "
|
||||
f"vollständig). Anzahl der Einträge ist die echte Gesamtzahl, pro Emoji "
|
||||
f"werden aber nur {max_examples_per_emoji} Beispiel-Autoren angezeigt."
|
||||
)
|
||||
analysis_4_data = fetch_analysis_4_data(institution_id)
|
||||
emoji_counts = Counter(row["emoji"] for row in analysis_4_data)
|
||||
analysis_4_data.sort(
|
||||
key=lambda row: (-emoji_counts[row["emoji"]], row["emoji"], row["author_id"])
|
||||
)
|
||||
|
||||
table_rows = []
|
||||
examples_shown = Counter()
|
||||
for row in analysis_4_data:
|
||||
emoji = row["emoji"]
|
||||
if examples_shown[emoji] >= max_examples_per_emoji:
|
||||
continue
|
||||
examples_shown[emoji] += 1
|
||||
table_rows.append([emoji, emoji_counts[emoji], row["author_id"]])
|
||||
|
||||
print_table(["Emoji", "Anzahl der Einträge", "OpenAlexID des Authors"], table_rows)
|
||||
|
||||
|
||||
def run_analysis_5(institution_id: str | None = None) -> None:
|
||||
print(
|
||||
"Analyse 5: Count-by auf display_name — wie viele Autoren-Dokumente "
|
||||
"denselben display_name (exakter Match) teilen."
|
||||
)
|
||||
analysis_5_data = fetch_analysis_5_data(institution_id)
|
||||
analysis_5_data.sort(key=lambda group: group["author_count"], reverse=True)
|
||||
print_table(
|
||||
["Display Name", "Anzahl"],
|
||||
[[group["display_name"], group["author_count"]] for group in analysis_5_data],
|
||||
)
|
||||
|
||||
|
||||
def run_analysis_6(institution_id: str | None = None) -> None:
|
||||
min_span = 100
|
||||
print(
|
||||
f"Analyse 6: Autoren, deren Publikationsspanne (max - min Jahr aus "
|
||||
f"counts_by_year) größer als {min_span} Jahre ist."
|
||||
)
|
||||
analysis_6_data = fetch_analysis_6_data(min_span, institution_id)
|
||||
analysis_6_data.sort(key=lambda entry: entry["span"], reverse=True)
|
||||
print_table(
|
||||
["OpenAlexID", "Von", "Bis", "Jahre"],
|
||||
[
|
||||
[entry["author_id"], entry["from_year"], entry["to_year"], entry["span"]]
|
||||
for entry in analysis_6_data
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
def run_analysis_7(institution_id: str | None = None) -> None:
|
||||
current_year = date.today().year
|
||||
print(
|
||||
f"Analyse 7: Publikationsjahre aus counts_by_year in der Zukunft "
|
||||
f"(> {current_year})."
|
||||
)
|
||||
analysis_7_data = fetch_analysis_7_data(institution_id)
|
||||
analysis_7_data.sort(key=lambda entry: entry["year"], reverse=True)
|
||||
print_table(
|
||||
["OpenAlexID", "Jahr"],
|
||||
[[entry["author_id"], entry["year"]] for entry in analysis_7_data],
|
||||
)
|
||||
|
||||
|
||||
def run_analysis_8(institution_id: str | None = None) -> None:
|
||||
min_works = 50
|
||||
max_citations = 5
|
||||
print(
|
||||
f"Analyse 8: Autoren mit works_count >= {min_works}, aber "
|
||||
f"cited_by_count <= {max_citations}. (mögliche 'Placeholder' Authoren)"
|
||||
)
|
||||
analysis_8_data = fetch_analysis_8_data(min_works, max_citations, institution_id)
|
||||
analysis_8_data.sort(key=lambda entry: entry["works_count"], reverse=True)
|
||||
print_table(
|
||||
["OpenAlexID", "Works Count", "Cited By Count"],
|
||||
[
|
||||
[entry["author_id"], entry["works_count"], entry["cited_by_count"]]
|
||||
for entry in analysis_8_data
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
ANALYSES = {
|
||||
1: run_analysis_1,
|
||||
2: run_analysis_2,
|
||||
3: run_analysis_3,
|
||||
4: run_analysis_4,
|
||||
5: run_analysis_5,
|
||||
6: run_analysis_6,
|
||||
7: run_analysis_7,
|
||||
8: run_analysis_8,
|
||||
}
|
||||
|
||||
|
||||
def parse_args() -> argparse.Namespace:
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Analysen über den openalex-authors Elasticsearch-Index.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--analysis",
|
||||
type=int,
|
||||
choices=sorted(ANALYSES),
|
||||
help="Nur diese Analyse ausführen (1-8). Ohne Angabe werden alle ausgeführt.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--filter-uni",
|
||||
metavar="INSTITUTION_ID",
|
||||
help="OpenAlex-Institutions-ID (z.B. I62318514), auf die alle Suchen "
|
||||
"gefiltert werden — inklusive Autoren, die nur einer Unter-Einheit "
|
||||
"(z.B. einem Institut) dieser Institution zugeordnet sind.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--save",
|
||||
action="store_true",
|
||||
help="Ausgabe zusätzlich in analysen/run_<timestamp>.txt speichern.",
|
||||
)
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
class Tee:
|
||||
|
||||
def __init__(self, *streams) -> None:
|
||||
self.streams = streams
|
||||
|
||||
def write(self, data: str) -> None:
|
||||
for stream in self.streams:
|
||||
stream.write(data)
|
||||
|
||||
def flush(self) -> None:
|
||||
for stream in self.streams:
|
||||
stream.flush()
|
||||
|
||||
|
||||
def run(args: argparse.Namespace) -> None:
|
||||
if args.filter_uni:
|
||||
print(f"Filter: nur Institution {args.filter_uni} (inkl. Unter-Einheiten)\n")
|
||||
|
||||
if args.analysis is not None:
|
||||
ANALYSES[args.analysis](args.filter_uni)
|
||||
return
|
||||
|
||||
for number, run_analysis in sorted(ANALYSES.items()):
|
||||
if number > 1:
|
||||
print()
|
||||
run_analysis(args.filter_uni)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
args = parse_args()
|
||||
|
||||
if not args.save:
|
||||
run(args)
|
||||
return
|
||||
|
||||
analysen_dir = Path(__file__).resolve().parent / "analysen"
|
||||
analysen_dir.mkdir(parents=True, exist_ok=True)
|
||||
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
||||
output_path = analysen_dir / f"run_{timestamp}.txt"
|
||||
|
||||
original_stdout = sys.stdout
|
||||
with output_path.open("w", encoding="utf-8") as file:
|
||||
sys.stdout = Tee(original_stdout, file)
|
||||
try:
|
||||
run(args)
|
||||
finally:
|
||||
sys.stdout = original_stdout
|
||||
|
||||
print(f"\nOutput gespeichert unter: {output_path}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,27 @@
|
||||
###
|
||||
POST https://project.nes.uni-due.de/elastic/openalex-authors/_search
|
||||
Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ==
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"size": 1,
|
||||
"query": {
|
||||
"term": {
|
||||
"id": "https://openalex.org/A5110029571"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
###
|
||||
POST https://project.nes.uni-due.de/elastic/openalex-authors/_search
|
||||
Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ==
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"_source": ["id", "display_name", "orcid"],
|
||||
"query": {
|
||||
"term": {
|
||||
"orcid": "https://orcid.org/0000-0002-1203-1424"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
requests
|
||||
python-dotenv
|
||||
@@ -0,0 +1,116 @@
|
||||
# Master's thesis on the INSE knowledge graph: three research plans
|
||||
|
||||
Status: proposal, 2026-09-17. Supersedes the engineering-oriented outline
|
||||
(`~/.claude/plans/consider-the-context-of-robust-hopcroft.md`) as the basis for choosing a topic.
|
||||
|
||||
Three alternative six-month theses, one per research community. Pick one; they share data and
|
||||
infrastructure but differ in research question, method and evaluation.
|
||||
|
||||
| | Plan | Community | One-line question |
|
||||
|---|---|---|---|
|
||||
| A | [Certain, possible, wrong](plan-a-knowledge-graphs.md) | Knowledge graphs / Semantic Web | What does identity-link error do to answers over a multi-source graph, and can answers carry that uncertainty? |
|
||||
| B | [Learning when not to answer](plan-b-nlp.md) | NLP | Can reinforcement fine-tuning make a small model reliable at text-to-Cypher, including abstaining and qualifying, in German and English? |
|
||||
| C | [Does the graph find the right people?](plan-c-information-retrieval.md) | Information retrieval | Does graph evidence improve expert and industry-partner retrieval when evaluated without temporal leakage? |
|
||||
|
||||
## Why the original outline is no longer a research topic
|
||||
|
||||
The original outline had five parts: build the graph, fix identities, write a benchmark, compare
|
||||
retrieval setups, fine-tune text-to-Cypher. Two things changed.
|
||||
|
||||
**The engineering is done.** `service/scripts/falkordb/bulk_load.py` builds the whole-university graph
|
||||
in about 20 minutes: 6,176 active UDE researchers, 204,110 works, 693,487 authors, 26,246 institutions,
|
||||
3,664 projects, 366 patents, 4,402 news articles, 547 companies and 10 million relationships, in 1.3 GB
|
||||
of FalkorDB memory. A local LLM (LM Studio, qwen3-8b) already queries it through the FalkorDB MCP
|
||||
server, and `service/scripts/falkordb/QUERIES.md` holds a tested query cookbook.
|
||||
|
||||
**The obvious research questions are published.** Literature check, September 2026 (from search
|
||||
results and abstracts; the student must read and verify each before citing):
|
||||
|
||||
| Idea in the original outline | Already covered by |
|
||||
|---|---|
|
||||
| Fine-tune a small model for text-to-Cypher, also with RL and execution feedback | Text2Cypher (Ozsoy et al., GenAIK 2025); "Refining Text2Cypher on Small Language Model with Reinforcement Learning" (Applied Sciences 15(15):8206, 2025, GRPO); Multi-Agent GraphRAG text-to-Cypher (arXiv 2511.08274) |
|
||||
| Generate training and test questions from the graph itself | CypherBench (ACL 2025); PIPE-Cypher (arXiv 2606.08481); KG2Cypher (arXiv 2606.27742); grounded KG data generation (arXiv 2606.14325) |
|
||||
| Non-English text-to-Cypher | Text2Cypher Across Languages (arXiv 2506.21445; Spanish, Turkish); adapter combination (arXiv 2601.16097). German is still missing, but adding a language alone is incremental |
|
||||
| Does the graph beat vector search, and on which question types | "When to use Graphs in RAG" / GraphRAG-Bench (ICLR 2026, arXiv 2506.05690); "RAG vs. GraphRAG" (arXiv 2502.11371); "Do We Still Need GraphRAG?" (arXiv 2604.09666); GraphRAG-Router (arXiv 2604.16401) |
|
||||
| Agentic, multi-step graph retrieval trained with RL | Graph-R1 (arXiv 2507.21892); KG-R1 (arXiv 2509.26383) |
|
||||
| Robustness of KG-augmented LLMs to a noisy graph | OKGQA-P (ACL 2025, arXiv 2410.08085); KG-RAG under incompleteness (2025); "Less is More: Denoising KGs for RAG" (arXiv 2510.14271). All use random perturbations or LLM-extracted graphs |
|
||||
|
||||
## What is still open, and why this project is well placed
|
||||
|
||||
Building and querying the `ude` graph produced five observations that the literature does not
|
||||
address and that the project's data can test:
|
||||
|
||||
1. **The links between sources are inferred, with structured error.** Patents carry no person IDs, so
|
||||
`INVENTOR_OF` rests on name matching (`match_type` institution / name / both). Company officers and
|
||||
news mentions are exact name matches (`common_name_warning`, `ambiguous`). One researcher named
|
||||
Thomas Kaiser matches 92 companies. OpenAlex itself over-merges profiles: a cohort profile
|
||||
"Róbert Langer" carries the MIT chemist's 251 industry partners. Prior robustness work perturbs
|
||||
graphs at random; nobody measures what realistic identity error does to answers.
|
||||
2. **Link semantics change numbers by a factor of six.** Industry co-publications of one researcher:
|
||||
61 with author-level affiliations, 10 when the affiliation must hold on the paper itself. Counting
|
||||
and ranking answers are fragile in a way lookups are not.
|
||||
3. **Observed and inferred edges sit side by side** (`DFG_ROLE` via ORCID is verified, `OFFICER_OF` is a
|
||||
name match), and every inferred edge records its method. That is the raw material for confidence-
|
||||
and provenance-aware answering, which exists in database theory (certain and possible answers,
|
||||
identity-linkage uncertainty) but not in LLM-based graph question answering.
|
||||
4. **A small local model fails silently.** Without the schema, qwen3-8b invented a property
|
||||
(`a.institution`), got nulls, and told the user the information "is not available". Separately, the
|
||||
server's 10,000-row result cap truncated a 206k-row read without any error. Neither failure is
|
||||
visible to the user. Reliability (answer, qualify, or abstain) is unexplored for text-to-Cypher;
|
||||
TrustSQL (arXiv 2403.15879) and GrailQAbility (ACL 2023) cover SQL and Freebase only, and
|
||||
abstention-aware RL (TruthRL, arXiv 2509.25760) covers open-domain QA only.
|
||||
5. **The graph has time.** Works, patents, projects and per-paper affiliations are dated up to 2026, so
|
||||
"who will start working with industry" can be evaluated on events that happened after a language
|
||||
model's knowledge cutoff, which is the only leakage-free way to evaluate LLM-based recommendation.
|
||||
|
||||
## Assets every plan can use
|
||||
|
||||
- The `ude` graph, loader (`bulk_load.py`, twelve idempotent phases), and query cookbook.
|
||||
- Edge-level evidence: `INVENTOR_OF.match_type`, `OFFICER_OF.common_name_warning`,
|
||||
`Author.hr_company_matches`, `MENTIONED_IN.ambiguous`, `DFG_ROLE.source`, `AUTHORED.institution_ids`,
|
||||
`Work.primary_category` (LLM classification of 187k works).
|
||||
- Existing evaluations to build on: `service/scripts/patents/data/author_patent_evaluation/` (three
|
||||
experiments on author-patent matching), `llm_evaluations/news_ident_person/` (50 labelled news
|
||||
articles), `analysis/career_stage/` (60 labelled researchers, 4.6% suspicious profiles),
|
||||
`service/scripts/profiling/founding_potential/`, `llm_evaluations/sentence_transformer/`.
|
||||
- LLM access through `inse.integrations.llm` (any OpenAI-compatible endpoint), a terminal harness that
|
||||
drives an LLM through the FalkorDB MCP tools, and the e5 embedding model in the service image.
|
||||
|
||||
## Fixed conditions (decided 2026-09-17)
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| Duration | 26 weeks |
|
||||
| Annotation | Two annotators, about 40 hours each |
|
||||
| Data release | Open sources only: OpenAlex (CC0), CORDIS, patent offices; DFG GEPRIS licence to be checked. Handelsregister and news-person links stay internal; results on them are reported in aggregate |
|
||||
| Compute | One 80 GB GPU: QLoRA supervised fine-tuning and GRPO on 7 to 8B models are feasible |
|
||||
| Tools | FalkorDB, Unsloth (as in the original outline) |
|
||||
| Data protection | One agreed paragraph with the chair before week 3; a section in the thesis |
|
||||
|
||||
## How to choose
|
||||
|
||||
| | A: knowledge graphs | B: NLP | C: information retrieval |
|
||||
|---|---|---|---|
|
||||
| Core novelty | Realistic identity error, certain/possible answers, LLM pipelines that use link confidence | Reliability-aware RL for text-to-Cypher, infeasible and uncertain questions, German | Leakage-free evaluation of graph-augmented expert and partner retrieval, graph-supervised reranker |
|
||||
| Main risk | Gold set quality; possible-worlds cost on aggregates | A close paper appears first; RL instability | Too few post-cutoff events; pooling depth |
|
||||
| Fine-tuning share | Small (one supervised model) | Central (SFT and GRPO, several models) | Medium (reranker) |
|
||||
| Annotation use | 500 to 600 identity links, answer-quality ratings | 400 question validations, German naturalness, error taxonomy | 1,500 to 2,000 relevance judgments |
|
||||
| Value to INSE after the thesis | Confidence on every cross-source link, fixes the biggest data-quality problem | A local model that can be trusted in the UI | A measured answer to "should scouting use the graph" and a reusable test collection |
|
||||
| Student profile | Data management, statistics, some ML | Deep learning, RL, NLP evaluation | IR evaluation, ranking, some graph ML |
|
||||
| Venues | ISWC, ESWC, CIKM, K-CAP; Semantic Web Journal, TGDK | ACL / EMNLP / NAACL Findings; TrustNLP, UncertaiNLP, KnowledgeNLP, GenAIK; LREC-COLING for the dataset | SIGIR (short, resource), ECIR, CIKM, ICTIR; JCDL |
|
||||
|
||||
Recommendation: Plan A is the most defensible against being scooped, because it depends on data only
|
||||
this project has (measured cross-source identity error), and it turns the most valuable part of the
|
||||
original outline (Part 2) into the research question. Plan B is the best fit if the student wants a
|
||||
model-centric thesis and the 80 GB GPU should be used fully. Plan C has the most direct product value.
|
||||
|
||||
Combining is possible but should be resisted: each plan fills 26 weeks. The one sensible overlap is
|
||||
that Plan B may borrow Plan A's "uncertain evidence" question category, and Plan C may report
|
||||
Plan A's robustness-to-identity-error as one ablation.
|
||||
|
||||
## Common first four weeks
|
||||
|
||||
1. Run INSE locally, obtain Elasticsearch read access, rebuild `ude` with `run.sh bulk --graph ude --reset`.
|
||||
2. Read `service/scripts/falkordb/README.md`, `QUERIES.md`, the profiling READMEs.
|
||||
3. Literature chapter skeleton from the reading list in the chosen plan; verify every citation.
|
||||
4. Data-protection paragraph agreed; annotation guidelines drafted; annotators booked.
|
||||
@@ -0,0 +1,127 @@
|
||||
# Plan A (knowledge graphs): Certain, possible, wrong
|
||||
|
||||
**Working title:** Certain, possible, wrong: question answering over a multi-source scholarly knowledge
|
||||
graph with uncertain identity links
|
||||
|
||||
**Target venues:** ISWC or ESWC (research or resources track), CIKM, K-CAP. Journal extension: Semantic
|
||||
Web Journal or TGDK.
|
||||
|
||||
## The problem in one paragraph
|
||||
|
||||
The INSE graph joins researchers to patents, companies, news and projects. Only some of those joins
|
||||
are observed (authorship, ORCID-verified DFG roles, DOI-linked project output). The rest are inferred
|
||||
from names, and OpenAlex's own author identities are partly over-merged. Every question that crosses
|
||||
a source boundary therefore rests on links that may be wrong, and counting or ranking questions can
|
||||
flip on a single false merge. Current work on LLMs and knowledge graphs either assumes a clean graph
|
||||
or perturbs it at random. This thesis measures real identity error, models how it propagates into
|
||||
answers, and tests whether answers can carry that uncertainty instead of hiding it.
|
||||
|
||||
## Gap and closest related work
|
||||
|
||||
- Robustness of KG-augmented LLMs is studied with random node and edge perturbations (OKGQA-P, ACL 2025,
|
||||
arXiv 2410.08085; KG-RAG under incompleteness, 2025) and denoising targets LLM-extracted graphs
|
||||
("Less is More", arXiv 2510.14271). Identity error is neither random nor local: it is concentrated on
|
||||
common names and on hubs, and it changes aggregates.
|
||||
- Database theory defines query answering under identity uncertainty (Moustafa et al., "Subgraph
|
||||
pattern matching over uncertain graphs with identity linkage uncertainty", arXiv 1305.7006;
|
||||
uncertainty-annotated databases, arXiv 1904.00234; combining entity resolution and query answering,
|
||||
arXiv 2303.07469; provenance of result probabilities in uncertain KGs, arXiv 2108.07758). None of it
|
||||
is connected to LLM-based question answering, and none is evaluated on a real multi-source graph of
|
||||
this kind.
|
||||
- Entity-resolution evaluation has matured (entity-centric evaluation for inventor disambiguation,
|
||||
arXiv 2404.05622; OpenAlex author accuracy with an LLM-assisted benchmark, arXiv 2502.11610; LLMs for
|
||||
entity matching, arXiv 2310.11244 and 2409.08185), but stops at precision and recall of the links.
|
||||
What a link error costs downstream is not measured.
|
||||
- A 2026 preprint names a "provenance gap" in incomplete KGQA (arXiv 2606.15833); the student should
|
||||
read it first and position against it.
|
||||
|
||||
## Research questions
|
||||
|
||||
- **RQ1. How wrong are the links?** Precision, recall and calibration of four link types: author to
|
||||
inventor, author to company officer, author to news mention, and OpenAlex over-merged author
|
||||
profiles. Which evidence (name rarity, topic overlap between IPC classes and OpenAlex topics,
|
||||
assignee match, temporal overlap, shared co-authors and co-inventors) predicts correctness?
|
||||
- **RQ2. How does link error reach the answer?** For lookup, multi-hop, counting and ranking queries:
|
||||
how much does the answer change per unit of link error, and does realistic error (sampled from the
|
||||
RQ1 error model) behave differently from the random perturbation used in prior benchmarks?
|
||||
- **RQ3. Can certain and possible answers be computed at interactive cost?** Monte Carlo sampling of
|
||||
possible worlds over link confidence, giving intervals for counts and stable sets for rankings,
|
||||
compared with exact computation on small subgraphs.
|
||||
- **RQ4. Does exposing link confidence make LLM question answering more reliable?** Text-to-Cypher
|
||||
and tool-using pipelines with and without access to confidence and provenance, including one
|
||||
supervised fine-tuned model that writes confidence-aware queries and reports "confirmed" versus
|
||||
"possible" results.
|
||||
|
||||
## Method
|
||||
|
||||
1. **Gold set (weeks 5 to 9).** About 550 candidate links, stratified by link type and by name
|
||||
frequency so that common names are over-sampled. Two annotators label each link independently
|
||||
using the evidence a human scout would check (ORCID, institutional pages, patent assignee, register
|
||||
entry); disagreements are adjudicated. Report Cohen's kappa. Budget: about 60 of the 80 hours.
|
||||
2. **Confidence model.** A small calibrated classifier (logistic regression and gradient boosting)
|
||||
over evidence features, trained on the gold set with cross-validation; reliability diagrams and
|
||||
expected calibration error. Output: a `confidence` and `method` on every inferred edge in the graph.
|
||||
3. **Error model and injection toolkit.** Fit where errors occur (by name frequency, degree, source),
|
||||
then generate corrupted graph variants three ways: uniformly random, degree-preserving, and
|
||||
realistic (sampled from the fitted model), at error rates from 1 to 20 percent.
|
||||
4. **Query set.** About 300 queries in the five types of the original outline (lookup, counting,
|
||||
multi-step, summary, over time), each tagged with the link types it crosses. Gold answers come from
|
||||
executing reference Cypher on a reference graph restricted to verified links.
|
||||
5. **Possible-worlds answering.** Sample link sets according to confidence, execute, aggregate:
|
||||
intervals for counts, inclusion probabilities for set answers, rank stability for top-k. Measure
|
||||
interval coverage against the reference and the cost per query.
|
||||
6. **LLM pipelines.** Four systems (schema-prompted text-to-Cypher, tool-using agent over MCP, the
|
||||
same two with confidence exposed) across three models (local 8B, the fine-tuned 8B, one hosted
|
||||
large model). The fine-tuned model is trained with Unsloth on graph-generated pairs whose target
|
||||
queries filter or split by confidence.
|
||||
|
||||
## Evaluation
|
||||
|
||||
| Question | Measures |
|
||||
|---|---|
|
||||
| RQ1 | Pairwise and entity-centric precision, recall, F1 per link type; kappa; ECE and reliability diagrams; feature ablation |
|
||||
| RQ2 | Answer change versus error rate per query type: exact match, Jaccard for sets, relative error for counts, Kendall tau for rankings; realistic versus random noise; with and without entity resolution (the ablation from the original outline) |
|
||||
| RQ3 | Coverage of 90 percent intervals, interval width, agreement with exact computation on subgraphs up to a tractable size, latency versus number of sampled worlds |
|
||||
| RQ4 | Execution accuracy; penalty-based reliability score in the style of TrustSQL; share of answers that correctly flag uncertain evidence; human rating of answer usefulness on 100 answers (remaining annotation hours); cost and latency |
|
||||
|
||||
Statistics: bootstrap confidence intervals everywhere, paired tests between systems, three seeds for
|
||||
anything trained.
|
||||
|
||||
## What gets released (open sources only)
|
||||
|
||||
- The author-to-inventor gold set (OpenAlex and patent-office data are public) with annotation guidelines.
|
||||
- The noise-injection toolkit and the possible-worlds query layer for FalkorDB.
|
||||
- The query set and reference answers over the open subgraph (OpenAlex, CORDIS, patents; DFG after a
|
||||
licence check). Officer and news results are reported in aggregate only.
|
||||
|
||||
## Schedule
|
||||
|
||||
| Weeks | Work |
|
||||
|---|---|
|
||||
| 1 to 4 | Common start; literature; annotation guidelines |
|
||||
| 5 to 9 | Gold set, agreement, RQ1 numbers |
|
||||
| 10 to 12 | Confidence model, edges annotated in the graph, error model |
|
||||
| 13 to 15 | Query set and reference answers |
|
||||
| 16 to 18 | Injection experiments (RQ2) |
|
||||
| 19 to 21 | Possible-worlds answering (RQ3) |
|
||||
| 22 to 24 | LLM pipelines and fine-tuned model (RQ4) |
|
||||
| 25 to 26 | Writing, paper draft |
|
||||
|
||||
Cut order if late: drop the fine-tuned model in RQ4 first (keep prompting-only pipelines), then reduce
|
||||
RQ3 to counts only. Never cut the gold set.
|
||||
|
||||
## Risks
|
||||
|
||||
- **Gold set too small for rare error types.** Mitigation: stratified sampling, and ORCID-verified
|
||||
links as an additional silver standard.
|
||||
- **Possible-worlds sampling too slow for aggregates over millions of edges.** Mitigation: restrict
|
||||
sampling to the edges a query touches; FalkorDB executes the per-world query in milliseconds.
|
||||
- **Reviewers ask for a second dataset.** Mitigation: run the injection experiments also on STaRK-MAG
|
||||
(arXiv 2404.13207) or a CypherBench graph, where only synthetic error is possible; that contrast is
|
||||
itself a result.
|
||||
|
||||
## Reading list to start from
|
||||
|
||||
arXiv 2410.08085, 2510.14271, 2606.15833, 1305.7006, 1904.00234, 2303.07469, 2108.07758, 2404.05622,
|
||||
2502.11610, 2310.11244, 2409.08185, 2403.15879, 2506.05690. All identifiers come from a literature search
|
||||
on 2026-09-17 and must be verified.
|
||||
@@ -0,0 +1,121 @@
|
||||
# Plan B (NLP): Learning when not to answer
|
||||
|
||||
**Working title:** Learning when not to answer: reliability-aware reinforcement fine-tuning of small
|
||||
language models for text-to-Cypher in German and English
|
||||
|
||||
**Target venues:** ACL, EMNLP or NAACL Findings; workshops TrustNLP, UncertaiNLP, KnowledgeNLP, GenAIK;
|
||||
LREC-COLING for the dataset.
|
||||
|
||||
## The problem in one paragraph
|
||||
|
||||
A local model that translates questions into Cypher fails in ways the user cannot see. In this
|
||||
project, an 8B model without the schema invented a property, received nulls, and reported that the
|
||||
information "is not available"; a server-side result cap silently truncated a count; and a question
|
||||
about a researcher named Thomas Kaiser can only be answered over 92 name-matched companies. Accuracy
|
||||
on answerable questions, which is what text-to-Cypher papers report, does not capture any of this. A
|
||||
deployable model must do one of three things: answer, answer with a qualification, or decline. This
|
||||
thesis builds the benchmark for that behaviour and tests whether reinforcement fine-tuning with
|
||||
execution-verified, penalty-aware rewards can teach it to a small model, in two languages.
|
||||
|
||||
## Gap and closest related work
|
||||
|
||||
- Text-to-Cypher fine-tuning is established, including RL: Text2Cypher (GenAIK 2025), GRPO refinement
|
||||
for small models (Applied Sciences 15(15):8206, 2025), multi-agent text-to-Cypher (arXiv 2511.08274),
|
||||
automatic dataset generation (CypherBench, ACL 2025; arXiv 2606.08481, 2606.27742, 2606.14325). All
|
||||
evaluate answerable questions only.
|
||||
- Reliability with infeasible questions exists for SQL (TrustSQL, arXiv 2403.15879, penalty-based
|
||||
scoring) and for Freebase KBQA (GrailQAbility, ACL 2023; RetinaQA, ACL 2024). Not for property graphs,
|
||||
not for LLM-era text-to-Cypher.
|
||||
- Abstention-aware RL exists for open-domain QA (TruthRL, arXiv 2509.25760, ternary reward; KARL,
|
||||
arXiv 2604.22779; TIAR, arXiv 2605.25850; search agents, arXiv 2607.10738). There the reward needs a
|
||||
judge or a gold string. Text-to-Cypher has a verifiable reward by execution, and a third outcome
|
||||
these papers do not have: the correct answer exists but rests on uncertain evidence.
|
||||
- Multilingual text-to-Cypher covers Spanish and Turkish (arXiv 2506.21445, 2601.16097). German is
|
||||
missing, and German compounds plus English entity names make it a real test, not a translation
|
||||
exercise.
|
||||
|
||||
## Research questions
|
||||
|
||||
- **RQ1. Benchmark.** What kinds of questions should a text-to-Cypher model not answer plainly over a
|
||||
real graph? Proposed categories: schema element missing, value missing, beyond Cypher, ambiguous
|
||||
entity (common names), outside the covered time span, aggregation over inferred links, and unsafe
|
||||
aggregation (result cap or timeout would truncate).
|
||||
- **RQ2. Training.** Does GRPO with an execution-verified, penalty-aware reward beat supervised
|
||||
fine-tuning on reliability, and how does the reward shape (binary, ternary, penalty-weighted,
|
||||
with a "qualified answer" outcome) trade accuracy against over-abstention?
|
||||
- **RQ3. Language.** How large is the German to English gap before and after training; does training
|
||||
in one language transfer; does translated training data suffice?
|
||||
- **RQ4. Generalisation.** Held-out schema regions (patents and companies unseen in training),
|
||||
compositional depth, paraphrases, and transfer to public graphs (a CypherBench graph extended with
|
||||
infeasible questions) so that the main results are reproducible without INSE data.
|
||||
- **RQ5. What changed?** Error taxonomy before and after RL; calibration of the decision to abstain.
|
||||
|
||||
## Method
|
||||
|
||||
1. **Dataset.** Templates filled from the graph, paraphrased by a larger model, in German and
|
||||
English, about 6,000 training and 1,200 test items, half answerable. Test entities and templates
|
||||
never occur in training. The open subgraph (OpenAlex, CORDIS, patents) is the release version; the
|
||||
full graph adds company and news questions for internal results.
|
||||
2. **Human validation (80 hours).** Two annotators validate about 400 test items for correctness of
|
||||
the label, category and German naturalness (kappa reported), and later classify about 300 model
|
||||
errors into the taxonomy.
|
||||
3. **Public counterpart.** The same infeasibility categories constructed on one CypherBench graph,
|
||||
which carries no real identity uncertainty; "aggregation over inferred links" is simulated there.
|
||||
4. **Models.** Qwen3-4B and 8B, Llama-3.1-8B, one Gemma model. Baselines: zero-shot and few-shot, a
|
||||
hosted large model, the public Neo4j text2cypher fine-tune, RL without abstention.
|
||||
5. **Training.** Unsloth QLoRA supervised fine-tuning, then GRPO. Reward from execution: result-set
|
||||
equivalence for answers, category match for abstentions, a graded reward for qualified answers
|
||||
(correct result plus correct flag), and a penalty c for wrong answers. Sweep c. Three seeds each.
|
||||
|
||||
## Evaluation
|
||||
|
||||
| Aspect | Measures |
|
||||
|---|---|
|
||||
| Answerable questions | Execution accuracy by result-set equivalence, by question type and hop count |
|
||||
| Reliability | TrustSQL-style score RS(c) for c in {0, 1, 10}; abstention precision, recall and F1 per category; over-abstention rate; risk-coverage curves |
|
||||
| Qualification | Share of uncertain-evidence questions answered with the correct flag; human usefulness rating on a sample |
|
||||
| Calibration | ECE of the answer-or-abstain decision; selective accuracy |
|
||||
| Language | German minus English gap per model and training regime; transfer matrix |
|
||||
| Generalisation | Held-out schema, depth, paraphrase; transfer to the CypherBench variant |
|
||||
| Cost | Tokens, latency, GPU hours per point of RS gained; data-efficiency curves |
|
||||
|
||||
Statistics: bootstrap intervals, McNemar between systems, three seeds, all prompts and decoding
|
||||
settings released.
|
||||
|
||||
## What gets released
|
||||
|
||||
Benchmark on the open subgraph in two languages, the CypherBench extension, LoRA adapters, reward and
|
||||
evaluation code.
|
||||
|
||||
## Schedule
|
||||
|
||||
| Weeks | Work |
|
||||
|---|---|
|
||||
| 1 to 4 | Common start; literature; category definitions |
|
||||
| 5 to 9 | Dataset generation, German versions, human validation |
|
||||
| 10 to 11 | Public counterpart on CypherBench |
|
||||
| 12 to 14 | Baselines and supervised fine-tuning |
|
||||
| 15 to 19 | GRPO, reward ablations, seeds |
|
||||
| 20 to 22 | Language and generalisation experiments |
|
||||
| 23 to 24 | Error taxonomy, calibration analysis |
|
||||
| 25 to 26 | Writing, paper draft |
|
||||
|
||||
Cut order if late: drop the third and fourth base model, then the qualified-answer outcome (keep
|
||||
answer versus abstain). Never cut the public counterpart; without it the NLP community cannot
|
||||
reproduce the main table.
|
||||
|
||||
## Risks
|
||||
|
||||
- **A close paper appears.** The space moves fast. Mitigation: the combination of uncertain-evidence
|
||||
questions, a real multi-source graph and German is hard to replicate; submit a dataset paper early.
|
||||
- **RL collapses into always abstaining or never abstaining.** Known from TruthRL-style training.
|
||||
Mitigation: balanced batches, penalty sweep, KL control, report the failure honestly if it persists.
|
||||
- **Template artefacts.** Models learn templates rather than semantics. Mitigation: paraphrase
|
||||
diversity, template-held-out test split, human-written subset of 150 questions.
|
||||
|
||||
## Reading list to start from
|
||||
|
||||
arXiv 2403.15879, 2212.10189, 2403.10849, 2509.25760, 2604.22779, 2605.25850, 2607.10738, 2506.21445,
|
||||
2601.16097, 2412.18702, 2511.08274, 2606.08481, 2606.27742, 2606.14325; Applied Sciences 15(15):8206;
|
||||
"Why Uncertainty Estimation Methods Fall Short in RAG" (Findings of ACL 2025). All identifiers come from
|
||||
a literature search on 2026-09-17 and must be verified.
|
||||
@@ -0,0 +1,129 @@
|
||||
# Plan C (information retrieval): Does the graph find the right people?
|
||||
|
||||
**Working title:** Does the graph find the right people? A leakage-free evaluation of graph-augmented
|
||||
expert and industry-partner retrieval for technology transfer
|
||||
|
||||
**Target venues:** SIGIR (short or resource paper), ECIR, CIKM, ICTIR. Alternative: JCDL.
|
||||
|
||||
## The problem in one paragraph
|
||||
|
||||
INSE exists to help scouts find the right researcher for a topic and the right partner for a
|
||||
researcher. Today that is keyword and vector search over profiles. The graph adds collaboration,
|
||||
projects, patents, per-paper industry affiliations and time. Whether that improves ranking is an
|
||||
empirical question, and the usual way to answer it with LLM-based rankers is broken: a model that has
|
||||
read the web up to 2025 already "knows" who collaborated with whom, so evaluating on past events
|
||||
measures memory, not retrieval. This thesis builds a test collection with two kinds of ground truth,
|
||||
human relevance judgments and events that happened after the models' knowledge cutoff, and uses it to
|
||||
compare text, graph and LLM rankers, including a reranker fine-tuned on supervision derived from the
|
||||
graph itself.
|
||||
|
||||
## Gap and closest related work
|
||||
|
||||
- Partner and collaboration recommendation is studied with graph learning on single sources:
|
||||
university-industry recommendation on a topic-institution graph (Scientometrics, 2025), technological
|
||||
partner recommendation from patents with temporal heterogeneous graphs (Information Processing and
|
||||
Management, 2025), hypergraph link prediction for collaboration (2026). They use one data source,
|
||||
institutions rather than people, and no LLM.
|
||||
- "Can LLMs Predict Academic Collaboration?" (arXiv 2604.01379) compares topology heuristics with LLM
|
||||
link prediction on co-authorship only, and temporal leakage is the open issue. Work on LLM
|
||||
backtesting shows how strongly leakage inflates results (arXiv 2602.17234, 2605.03762, 2605.18843).
|
||||
- STaRK-MAG (NeurIPS D&B 2024, arXiv 2404.13207) evaluates retrieval over a scholarly graph with
|
||||
synthetic queries for papers, not people, and without time.
|
||||
- GraphRAG versus RAG comparisons (arXiv 2506.05690, 2502.11371, 2604.09666) use text corpora and
|
||||
question answering, not ranking of people with graded relevance.
|
||||
- Classic expert-finding test collections (W3C, CERC, academic collections) predate LLM rankers and
|
||||
multi-source graphs. There is no current collection for expert finding in a German research setting.
|
||||
|
||||
## Tasks
|
||||
|
||||
- **T1 Expert finding.** Query: a topic or need as a scout would phrase it, in German or English.
|
||||
Result: ranked UDE researchers.
|
||||
- **T2 Partner recommendation.** Query: a researcher. Result: ranked companies (OpenAlex institutions
|
||||
of type `company`) the researcher is likely to start working with.
|
||||
|
||||
## Research questions
|
||||
|
||||
- **RQ1.** Does graph evidence improve ranking beyond text? Which evidence (co-authorship, projects,
|
||||
patents, per-paper industry affiliation, recency) carries the gain, for T1 and T2 separately?
|
||||
- **RQ2.** Can a small reranker fine-tuned on supervision derived from the graph (future links as
|
||||
positives, topic-similar non-links as hard negatives) match a large zero-shot LLM reranker at a
|
||||
fraction of the cost?
|
||||
- **RQ3.** How much of an LLM ranker's quality is parametric memory? Compare events before and after
|
||||
the model's knowledge cutoff, and rankings with researcher names masked.
|
||||
- **RQ4.** Who benefits? Exposure of early-career versus established researchers under each ranker,
|
||||
and sensitivity of rankings to identity errors (junk company institutions, over-merged profiles).
|
||||
|
||||
## Method
|
||||
|
||||
1. **Temporal split.** Freeze the graph at a cut date T (end of 2023 for training signals). Test
|
||||
events after T: first-time per-paper industry affiliations (`INVOLVES` to a company with no earlier
|
||||
joint work), new patents, new CORDIS and DFG project participations. A second, smaller test set uses
|
||||
only events after the newest evaluated model's knowledge cutoff.
|
||||
2. **Topics.** 50 to 60 T1 topics drawn from real material: CORDIS call topics, IPC class
|
||||
descriptions, news themes, and needs phrased by the chair's transfer contacts, each in German and
|
||||
English. T2 uses about 300 researchers with at least one post-T event.
|
||||
3. **Relevance judgments (80 hours).** Pooled top-20 of all systems per T1 topic, graded 0 to 3 by two
|
||||
annotators with an overlap sample for agreement: about 1,500 to 2,000 judgments at two to three
|
||||
minutes each. Profiles shown to annotators come from public OpenAlex data.
|
||||
4. **Systems.** BM25 and dense e5 retrieval over researcher profiles (both exist in INSE), hybrid;
|
||||
graph rankers (personalised PageRank, meta-path counts, a temporal graph neural network); LLM
|
||||
listwise reranker with and without a verbalised evidence subgraph; the fine-tuned reranker
|
||||
(Unsloth, 4 to 8B, trained on graph-derived pairs); an agentic system using the graph through MCP
|
||||
as the high-cost reference.
|
||||
5. **Leakage controls.** Name masking, pre- versus post-cutoff comparison, and a check that no
|
||||
retrieval document postdates T.
|
||||
|
||||
## Evaluation
|
||||
|
||||
| Aspect | Measures |
|
||||
|---|---|
|
||||
| T1 effectiveness | nDCG@10, MAP, Recall@100 on human judgments; German versus English queries |
|
||||
| T2 effectiveness | MRR, Hits@10, nDCG@10 on post-T events; separately on post-cutoff events |
|
||||
| Evidence ablation | Drop one edge type at a time; recency decay on or off |
|
||||
| Fine-tuning | Reranker versus zero-shot large LLM: effectiveness, tokens, latency, GPU hours; training-size curve |
|
||||
| Leakage | Performance difference pre- versus post-cutoff and masked versus unmasked, per ranker |
|
||||
| Exposure and robustness | Share of top-10 exposure by career stage; rank change after removing junk institutions and suspected merged profiles |
|
||||
|
||||
Statistics: paired randomisation tests with Holm correction, confidence intervals by bootstrap over
|
||||
topics, inter-annotator agreement (kappa, and Krippendorff's alpha for graded labels).
|
||||
|
||||
## What gets released
|
||||
|
||||
The test collection (topics in two languages, graded judgments on public OpenAlex author IDs,
|
||||
post-T event lists from open sources), the temporal split protocol, reranker adapters and code.
|
||||
Company-register and news evidence is used internally only.
|
||||
|
||||
## Schedule
|
||||
|
||||
| Weeks | Work |
|
||||
|---|---|
|
||||
| 1 to 4 | Common start; literature; temporal split and event extraction |
|
||||
| 5 to 7 | Topics, annotation guidelines, text baselines |
|
||||
| 8 to 11 | Graph rankers, first pooled runs |
|
||||
| 12 to 15 | Relevance judgments (annotators), agreement |
|
||||
| 16 to 19 | LLM rerankers and the fine-tuned reranker |
|
||||
| 20 to 22 | Leakage, ablation, exposure and robustness analyses |
|
||||
| 23 to 24 | Second pooling round for late systems, significance testing |
|
||||
| 25 to 26 | Writing, paper draft |
|
||||
|
||||
Cut order if late: drop the agentic reference system, then T2's graph neural network (keep PageRank
|
||||
and meta-paths). Never cut the post-cutoff test set; it is the contribution.
|
||||
|
||||
## Risks
|
||||
|
||||
- **Too few post-cutoff events.** UDE alone yields a limited number of first-time industry links per
|
||||
year. Mitigation: add the other two default organisations (Bochum, Dortmund) with the same loader,
|
||||
which triples the cohort at no engineering cost.
|
||||
- **Pooling bias against systems added late.** Mitigation: a second pooling round in weeks 23 to 24,
|
||||
and report condensed-list metrics.
|
||||
- **Identity errors contaminate ground truth.** A "new industry link" may be a mis-resolved
|
||||
institution. Mitigation: per-paper affiliations only (not author-level), a manual check of a sample
|
||||
of test events, and junk-institution filtering documented in the thesis.
|
||||
|
||||
## Reading list to start from
|
||||
|
||||
arXiv 2404.13207, 2604.01379, 2607.04529, 2602.17234, 2605.03762, 2605.18843, 2506.05690, 2502.11371,
|
||||
2604.09666; "Recommending university-industry collaboration: a topic-institution graph-based solution"
|
||||
(Scientometrics, 2025); "From patents to partners" (Information Processing and Management, 2025);
|
||||
"Guiding retrieval using LLM-based listwise rankers" (ECIR 2025). All identifiers come from a
|
||||
literature search on 2026-09-17 and must be verified.
|
||||
@@ -0,0 +1,282 @@
|
||||
# Query cookbook for the `ude` graph
|
||||
|
||||
Cypher examples for the whole-university graph built by `bulk_load.py` (FalkorDB Browser at
|
||||
http://localhost:3000, graph `ude`, or `FalkorDB(host="localhost").select_graph("ude").ro_query(...)`).
|
||||
Every example was run against the graph on 2026-09-15; timings are from that run.
|
||||
|
||||
Conventions:
|
||||
|
||||
- `Author` nodes of the university's own researchers carry the extra label `Cohort` (indexed).
|
||||
Start queries there whenever you can.
|
||||
- `CO_AUTHOR` edges are undirected in meaning (stored from the smaller to the larger author id);
|
||||
match them without an arrow: `(a)-[c:CO_AUTHOR]-(b)`.
|
||||
- Aggregations render as tables. To see a graph, return nodes and relationships (or paths).
|
||||
- Queries that touch the whole graph take 2 to 20 s; raise the browser's timeout first
|
||||
(`docker exec pensive_tu redis-cli GRAPH.CONFIG SET TIMEOUT 60000`).
|
||||
- Results are capped at 10,000 rows by the server (`RESULTSET_SIZE`).
|
||||
|
||||
## Overview
|
||||
|
||||
```cypher
|
||||
MATCH (n) RETURN labels(n), count(n) ORDER BY count(n) DESC
|
||||
```
|
||||
```cypher
|
||||
MATCH ()-[r]->() RETURN type(r), count(r) ORDER BY count(r) DESC
|
||||
```
|
||||
|
||||
Everything around one researcher, for the canvas:
|
||||
|
||||
```cypher
|
||||
MATCH (a:Cohort {name: 'Nikolai Axmacher'})-[r]-(n) RETURN a, r, n LIMIT 300
|
||||
```
|
||||
|
||||
Source coverage of the cohort (works, projects, patents, news, companies):
|
||||
|
||||
```cypher
|
||||
MATCH (a:Cohort)
|
||||
OPTIONAL MATCH (a)-[:AUTHORED]->(w:Work) WITH a, count(DISTINCT w) AS works
|
||||
OPTIONAL MATCH (a)-[:CONTRIBUTED_TO|DFG_ROLE]->(p:Project) WITH a, works, count(DISTINCT p) AS projects
|
||||
OPTIONAL MATCH (a)-[:INVENTOR_OF]->(pt:Patent) WITH a, works, projects, count(DISTINCT pt) AS patents
|
||||
OPTIONAL MATCH (a)-[:MENTIONED_IN]->(n:NewsArticle) WITH a, works, projects, patents, count(DISTINCT n) AS news
|
||||
OPTIONAL MATCH (a)-[:OFFICER_OF]->(c:Company) WITH a, works, projects, patents, news, count(DISTINCT c) AS companies
|
||||
RETURN count(a) AS cohort,
|
||||
sum(CASE WHEN works > 0 THEN 1 ELSE 0 END) AS with_works,
|
||||
sum(CASE WHEN projects > 0 THEN 1 ELSE 0 END) AS with_projects,
|
||||
sum(CASE WHEN patents > 0 THEN 1 ELSE 0 END) AS with_patents,
|
||||
sum(CASE WHEN news > 0 THEN 1 ELSE 0 END) AS with_news,
|
||||
sum(CASE WHEN companies > 0 THEN 1 ELSE 0 END) AS with_companies
|
||||
```
|
||||
|
||||
## Topics, subfields, fields and domains of the institution
|
||||
|
||||
The path from the institution: `Institution <-[:REPRESENTS]- Organization <-[:MEMBER_OF]- Cohort`.
|
||||
|
||||
Domains with counts (2.1 s):
|
||||
|
||||
```cypher
|
||||
MATCH (:Institution {id: 'I62318514'})<-[:REPRESENTS]-(:Organization)<-[:MEMBER_OF]-(:Cohort)-[:AUTHORED]->(w:Work)
|
||||
-[:HAS_TOPIC]->(t:Topic)-[:IN_SUBFIELD]->(s:Subfield)-[:IN_FIELD]->(f:Field)-[:IN_DOMAIN]->(d:Domain)
|
||||
RETURN d.name AS domain, count(DISTINCT f) AS fields, count(DISTINCT s) AS subfields,
|
||||
count(DISTINCT t) AS topics, count(DISTINCT w) AS works
|
||||
ORDER BY works DESC
|
||||
```
|
||||
|
||||
Full hierarchy table, strongest topics first (2.4 s; drop `LIMIT` for all 4,336 topics):
|
||||
|
||||
```cypher
|
||||
MATCH (:Institution {id: 'I62318514'})<-[:REPRESENTS]-(:Organization)<-[:MEMBER_OF]-(:Cohort)-[:AUTHORED]->(w:Work)
|
||||
-[:HAS_TOPIC]->(t:Topic)-[:IN_SUBFIELD]->(s:Subfield)-[:IN_FIELD]->(f:Field)-[:IN_DOMAIN]->(d:Domain)
|
||||
RETURN d.name AS domain, f.name AS field, s.name AS subfield, t.name AS topic, count(DISTINCT w) AS works
|
||||
ORDER BY works DESC LIMIT 100
|
||||
```
|
||||
|
||||
Fields by number of researchers, using OpenAlex's author-level topics (0.1 s):
|
||||
|
||||
```cypher
|
||||
MATCH (:Institution {id: 'I62318514'})<-[:REPRESENTS]-(:Organization)<-[:MEMBER_OF]-(a:Cohort)-[:WORKS_ON]->(t:Topic)
|
||||
-[:IN_SUBFIELD]->(s:Subfield)-[:IN_FIELD]->(f:Field)-[:IN_DOMAIN]->(d:Domain)
|
||||
RETURN d.name AS domain, f.name AS field, count(DISTINCT a) AS researchers, count(DISTINCT t) AS topics
|
||||
ORDER BY researchers DESC
|
||||
```
|
||||
|
||||
### Graph versions via the research profile edges
|
||||
|
||||
The `profile` phase materialises `(Institution)-[:ACTIVE_IN {level, works, researchers}]->(Topic|Subfield|Field|Domain)`,
|
||||
so the counts live on drawable edges. Set the node caption of Domain/Field/Subfield/Topic to `name`.
|
||||
|
||||
Domains as a star around the institution, and domains with their fields:
|
||||
|
||||
```cypher
|
||||
MATCH (i:Institution {id: 'I62318514'})-[r:ACTIVE_IN]->(d:Domain) RETURN i, r, d
|
||||
```
|
||||
```cypher
|
||||
MATCH (i:Institution {id: 'I62318514'})-[r:ACTIVE_IN]->(f:Field)-[c:IN_DOMAIN]->(d:Domain)
|
||||
RETURN i, r, f, c, d
|
||||
```
|
||||
|
||||
Tree of the strongest topics attached to the institution (lower `800` to widen; add
|
||||
`AND d.name = 'Physical Sciences'` for one domain):
|
||||
|
||||
```cypher
|
||||
MATCH (i:Institution {id: 'I62318514'})-[r:ACTIVE_IN {level: 'topic'}]->(t:Topic) WHERE r.works >= 800
|
||||
MATCH (t)-[a:IN_SUBFIELD]->(s:Subfield)-[b:IN_FIELD]->(f:Field)-[c:IN_DOMAIN]->(d:Domain)
|
||||
RETURN i, r, t, a, s, b, f, c, d
|
||||
```
|
||||
|
||||
Fields by researchers:
|
||||
|
||||
```cypher
|
||||
MATCH (i:Institution {id: 'I62318514'})-[r:ACTIVE_IN]->(f:Field) WHERE r.researchers >= 300
|
||||
RETURN i, r, f
|
||||
```
|
||||
|
||||
Without materialised edges: aggregate in a `WITH`, keep the top nodes, match the hierarchy again
|
||||
and return nodes and relationships (the counts are not shown, the institution is not connected):
|
||||
|
||||
```cypher
|
||||
MATCH (:Institution {id: 'I62318514'})<-[:REPRESENTS]-(:Organization)<-[:MEMBER_OF]-(:Cohort)-[:AUTHORED]->(w:Work)-[:HAS_TOPIC]->(t:Topic)
|
||||
WITH t, count(DISTINCT w) AS works ORDER BY works DESC LIMIT 40
|
||||
MATCH (t)-[a:IN_SUBFIELD]->(s:Subfield)-[b:IN_FIELD]->(f:Field)-[c:IN_DOMAIN]->(d:Domain)
|
||||
RETURN t, a, s, b, f, c, d
|
||||
```
|
||||
|
||||
## Collaboration
|
||||
|
||||
Strongest collaborations inside the university:
|
||||
|
||||
```cypher
|
||||
MATCH (a:Cohort)-[c:CO_AUTHOR]->(b:Cohort)
|
||||
RETURN a.name, b.name, c.weight, c.first_year, c.last_year ORDER BY c.weight DESC LIMIT 20
|
||||
```
|
||||
|
||||
Top external partner institutions (4 s):
|
||||
|
||||
```cypher
|
||||
MATCH (a:Cohort)-[:CO_AUTHOR]-(b:Author)-[:AFFILIATED_WITH]->(i:Institution)
|
||||
WHERE NOT b:Cohort AND i.id <> 'I62318514'
|
||||
RETURN i.name, i.country_code, count(DISTINCT b) AS partners ORDER BY partners DESC LIMIT 20
|
||||
```
|
||||
|
||||
## Industry collaborations
|
||||
|
||||
OpenAlex types institutions as `education`, `healthcare`, `company`, `government`, `nonprofit`,
|
||||
`facility`, `funder` or `other`; the value is stored as `Institution.type`. Industry means
|
||||
`type = 'company'`. Two caveats: OpenAlex contains junk "companies" resolved from generic
|
||||
affiliation strings (`Faculty (United Kingdom)`, `Signal Processing (United States)`,
|
||||
`Engineering (Italy)`), and the author-level `AFFILIATED_WITH` edge is not tied to a paper, so a
|
||||
co-author who was ever at a company counts on every shared work. The `affiliations` phase adds the
|
||||
per-work view: `AUTHORED.institution_ids` and `(Work)-[:INVOLVES {authors}]->(Institution)`.
|
||||
Prefer the per-work queries below; the author-level ones are kept as a quick approximation.
|
||||
|
||||
How much it matters (validated 2026-09-15): for Daniel Erni the per-work view gives 10 industry
|
||||
co-publications with 4 companies (IBM, CETC, CSEM, ID Quantique), the author-level view claims 61
|
||||
joint works with 8 companies. University-wide, 15,569 works involve 3,874 companies. A further
|
||||
caveat is OpenAlex author disambiguation: a few cohort profiles are merged with namesakes
|
||||
(`Róbert Langer` carries the MIT chemist's industry ties), so check `orcid` before trusting an outlier.
|
||||
|
||||
### Per work (precise)
|
||||
|
||||
Companies on the papers of one researcher, with the co-authors who were at the company on that paper:
|
||||
|
||||
```cypher
|
||||
MATCH (a:Cohort {name: 'Daniel Erni'})-[:AUTHORED]->(w:Work)-[:INVOLVES]->(i:Institution {type: 'company'})
|
||||
MATCH (w)<-[e:AUTHORED]-(b:Author) WHERE i.id IN e.institution_ids
|
||||
RETURN i.name AS company, i.country_code AS country, count(DISTINCT w) AS works,
|
||||
collect(DISTINCT b.name)[0..4] AS company_coauthors
|
||||
ORDER BY works DESC
|
||||
```
|
||||
|
||||
The same as a graph (researcher, shared works, companies):
|
||||
|
||||
```cypher
|
||||
MATCH (a:Cohort {name: 'Daniel Erni'})-[x:AUTHORED]->(w:Work)-[v:INVOLVES]->(i:Institution {type: 'company'})
|
||||
RETURN a, x, w, v, i
|
||||
```
|
||||
|
||||
Industry partners of researchers from a field (author-level OpenAlex topics define the field):
|
||||
|
||||
```cypher
|
||||
MATCH (a:Cohort)-[:WORKS_ON]->(:Topic)-[:IN_SUBFIELD]->()-[:IN_FIELD]->(:Field {name: 'Engineering'})
|
||||
WITH DISTINCT a
|
||||
MATCH (a)-[:AUTHORED]->(w:Work)-[:INVOLVES]->(i:Institution {type: 'company'})
|
||||
RETURN i.name AS company, i.country_code AS country,
|
||||
count(DISTINCT a) AS ude_researchers, count(DISTINCT w) AS joint_works
|
||||
ORDER BY ude_researchers DESC LIMIT 25
|
||||
```
|
||||
|
||||
Researchers of a field ranked by industry ties:
|
||||
|
||||
```cypher
|
||||
MATCH (a:Cohort)-[:WORKS_ON]->(:Topic)-[:IN_SUBFIELD]->()-[:IN_FIELD]->(:Field {name: 'Engineering'})
|
||||
WITH DISTINCT a
|
||||
MATCH (a)-[:AUTHORED]->(w:Work)-[:INVOLVES]->(i:Institution {type: 'company'})
|
||||
RETURN a.name, count(DISTINCT i) AS companies, count(DISTINCT w) AS works, collect(DISTINCT i.name)[0..3] AS sample
|
||||
ORDER BY companies DESC LIMIT 20
|
||||
```
|
||||
|
||||
Industry co-publications per year for one researcher:
|
||||
|
||||
```cypher
|
||||
MATCH (a:Cohort {name: 'Daniel Erni'})-[:AUTHORED]->(w:Work)-[:INVOLVES]->(i:Institution {type: 'company'})
|
||||
RETURN w.year, count(DISTINCT w) AS works, collect(DISTINCT i.name)[0..3] AS companies
|
||||
ORDER BY w.year DESC
|
||||
```
|
||||
|
||||
Graph view for a field: researchers, their industry co-authored works and the companies
|
||||
(the `LIMIT` keeps the canvas readable):
|
||||
|
||||
```cypher
|
||||
MATCH (a:Cohort)-[:WORKS_ON]->(:Topic)-[:IN_SUBFIELD]->()-[:IN_FIELD]->(:Field {name: 'Engineering'})
|
||||
WITH DISTINCT a
|
||||
MATCH (a)-[x:AUTHORED]->(w:Work)-[v:INVOLVES]->(i:Institution {type: 'company'})
|
||||
WITH a, x, w, v, i ORDER BY w.year DESC LIMIT 200
|
||||
RETURN a, x, w, v, i
|
||||
```
|
||||
|
||||
### Author level (approximate, no `affiliations` phase needed)
|
||||
|
||||
```cypher
|
||||
MATCH (a:Cohort {name: 'Daniel Erni'})-[c:CO_AUTHOR]-(b:Author)-[:AFFILIATED_WITH]->(i:Institution {type: 'company'})
|
||||
RETURN i.name AS company, i.country_code AS country, collect(DISTINCT b.name)[0..3] AS coauthors, sum(c.weight) AS joint_works
|
||||
ORDER BY joint_works DESC LIMIT 20
|
||||
```
|
||||
```cypher
|
||||
MATCH (a:Cohort {name: 'Daniel Erni'})-[c:CO_AUTHOR]-(b:Author)-[f:AFFILIATED_WITH]->(i:Institution {type: 'company'})
|
||||
RETURN a, c, b, f, i
|
||||
```
|
||||
|
||||
### Handelsregister links (founders and officers, not co-authorship)
|
||||
|
||||
```cypher
|
||||
MATCH (a:Cohort)-[r:OFFICER_OF]->(c:Company)
|
||||
RETURN a.name, c.name, c.registered_office, r.positions ORDER BY a.name LIMIT 50
|
||||
```
|
||||
```cypher
|
||||
MATCH (a:Cohort)-[r:OFFICER_OF]->(c:Company) RETURN a, r, c LIMIT 200
|
||||
```
|
||||
|
||||
## Projects, funders, patents, news
|
||||
|
||||
Projects per source and link type:
|
||||
|
||||
```cypher
|
||||
MATCH (x)-[r:OUTPUT_OF|CONTRIBUTED_TO|DFG_ROLE|PARTICIPATES_IN]->(p:Project)
|
||||
RETURN p.source, type(r), count(r) ORDER BY p.source, count(r) DESC
|
||||
```
|
||||
|
||||
EU consortium partners of the university:
|
||||
|
||||
```cypher
|
||||
MATCH (:Institution {id: 'I62318514'})-[:PARTICIPATES_IN]->(p:Project)<-[:PARTICIPATES_IN]-(o:EuOrganization)
|
||||
WHERE o.name <> 'UNIVERSITAET DUISBURG-ESSEN'
|
||||
RETURN o.name, o.country, count(DISTINCT p) AS shared ORDER BY shared DESC LIMIT 20
|
||||
```
|
||||
|
||||
Funders of the cohort (author level):
|
||||
|
||||
```cypher
|
||||
MATCH (a:Cohort)-[r:FUNDED_BY]->(f:Funder)
|
||||
RETURN f.name, count(a) AS researchers, sum(r.publications) AS publications ORDER BY researchers DESC LIMIT 20
|
||||
```
|
||||
|
||||
Patents with their OpenAlex topics:
|
||||
|
||||
```cypher
|
||||
MATCH (a:Author)-[:INVENTOR_OF]->(p:Patent)
|
||||
OPTIONAL MATCH (p)-[:HAS_TOPIC]->(t:Topic)
|
||||
RETURN a.name, p.source, p.year, left(p.title, 60), collect(t.name)[0..2] ORDER BY p.year DESC LIMIT 20
|
||||
```
|
||||
|
||||
News mentions with topics:
|
||||
|
||||
```cypher
|
||||
MATCH (a:Cohort)-[m:MENTIONED_IN]->(n:NewsArticle) OPTIONAL MATCH (n)-[:HAS_TOPIC]->(t:Topic)
|
||||
RETURN a.name, n.title, n.date, m.ambiguous, collect(DISTINCT t.name)[0..3] ORDER BY n.date DESC LIMIT 20
|
||||
```
|
||||
|
||||
Work classifications (LLM):
|
||||
|
||||
```cypher
|
||||
MATCH (w:Work) WHERE w.primary_category IS NOT NULL
|
||||
RETURN w.primary_category, count(w) ORDER BY count(w) DESC
|
||||
```
|
||||
@@ -0,0 +1,289 @@
|
||||
# FalkorDB example: a researcher graph from the INSE sources
|
||||
|
||||
`load_graph.py` builds a small knowledge graph in [FalkorDB](https://www.falkordb.com/) around a
|
||||
couple of researchers from the predefined ("default") organizations in
|
||||
`src/data/predefined_accounts.json`, i.e. Universität Duisburg-Essen (`I62318514`),
|
||||
Ruhr-Universität Bochum (`I904495901`) and TU Dortmund (`I200332995`).
|
||||
|
||||
It does not talk to OpenAlex, EPO or CORDIS directly. Every fact comes from the backend's existing
|
||||
source logic in `src/main/inse`, which reads the INSE Elasticsearch mirrors, so the graph shows
|
||||
exactly what the REST API can already see:
|
||||
|
||||
| Source | Backend function | Graph |
|
||||
| --- | --- | --- |
|
||||
| OpenAlex authors (profile, ORCID, metrics, affiliations, topics) | `authors.v2.service.search_authors` / `get_author_by_id_strict_or_raise` | `Author`, `Institution`, `Topic`, `AFFILIATED_WITH`, `WORKS_ON` |
|
||||
| OpenAlex works incl. co-authors and their institutions | `works.v2.service.get_author_works` | `Work`, `AUTHORED`, `HAS_TOPIC`, co-author `Author`s |
|
||||
| CORDIS (EU) and DFG projects, bridged through publication DOIs | `works.logic.get_publication_dois_of_author`, `projects.projects_search_client.get_cordis_eu_project_ids_by_dois` / `get_dfg_project_ids_by_dois`, `get_enriched_cordis_project_by_id`, `get_dfg_project_by_id` | `Project`, `CONTRIBUTED_TO` |
|
||||
| EPO + USPTO patents (name matching with institution guard) | `patents.authors.logic.get_patents_by_author_id` | `Patent`, `INVENTOR_OF`, `HAS_TOPIC` |
|
||||
| Funders of the author's funded publications | `funders.logic.get_funders_by_author_id` | `Funder`, `FUNDED_BY` (author and work level) |
|
||||
| News mentions (UDE "aktuell", CC-News) | `news.logic.get_news_by_author` | `NewsArticle`, `MENTIONED_IN`, `HAS_TOPIC` |
|
||||
| Handelsregister officer matches | `company_connections.logic.get_company_connections_by_author_id` | `Company`, `OFFICER_OF` |
|
||||
| Predefined organizations | `src/data/predefined_accounts.json`, `institutions.v2.service.get_institution_by_id` | `Organization`, `REPRESENTS`, `MEMBER_OF` |
|
||||
|
||||
Co-authorship is not computed in Python. After loading, one Cypher query derives
|
||||
`(:Author)-[:CO_AUTHOR {weight, first_year, last_year}]->(:Author)` from the `AUTHORED` edges,
|
||||
which is the part the in-service collaboration-graph API currently leaves to the client.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
1. A FalkorDB server. The quickest way is the official image, which also serves a browser UI on
|
||||
port 3000:
|
||||
|
||||
```bash
|
||||
docker run -d --name falkordb -p 6379:6379 -p 3000:3000 falkordb/falkordb:latest
|
||||
```
|
||||
|
||||
2. The service image `inse-service:1.0.0` (built by `./gradlew :service:createImage`, and already
|
||||
present if you ever ran `./gradlew :service:serve`). The script imports the `inse` package, whose
|
||||
`util` module pulls in sentence-transformers/torch, so the image is the easiest runtime that has
|
||||
every dependency. `src/main/inse/.env` must contain the Elasticsearch credentials as usual.
|
||||
|
||||
## Run
|
||||
|
||||
```bash
|
||||
cd service
|
||||
scripts/falkordb/run.sh # 2 researchers per default organization
|
||||
scripts/falkordb/run.sh --reset --organization Duisburg --per-org 3
|
||||
scripts/falkordb/run.sh --author-id A5040796987 --author-id A5122994949 # explicit researchers, added incrementally
|
||||
scripts/falkordb/run.sh --no-write --dump /scripts/falkordb/graph.json # collect only, inspect the JSON
|
||||
scripts/falkordb/run.sh --help
|
||||
```
|
||||
|
||||
`run.sh` starts a throwaway container from the service image, mounts `src/main`, `src/data` and
|
||||
`scripts`, installs `falkordb` from `requirements.txt` and reaches the server on the host through
|
||||
`host.docker.internal`. Override the target with `FALKORDB_HOST`, `FALKORDB_PORT`,
|
||||
`FALKORDB_PASSWORD` and `FALKORDB_GRAPH` (default graph name `inse`).
|
||||
|
||||
Loads are idempotent: every node and edge is `MERGE`d on its `id`, so re-running or adding
|
||||
researchers with `--author-id` extends the same graph. `--reset` drops the graph right before
|
||||
writing, after all sources were collected. One failing source is logged and skipped, it does not
|
||||
abort the load.
|
||||
|
||||
A default run (six researchers, 40 works each) takes a few minutes and ends with roughly 2,300 nodes
|
||||
and 9,000 relationships. The slow parts are the DOI-to-project lookups (one detail query per hit)
|
||||
and the EPO/USPTO scans for common names.
|
||||
|
||||
### How the researchers are picked
|
||||
|
||||
For each organization the script reuses the backend's active-cohort membership query
|
||||
(`authors.institution_membership_query.build_institution_membership_query`, last known institution
|
||||
plus an affiliation since the current year minus two) and then narrows the candidates so the graph
|
||||
stays small and well disambiguated:
|
||||
|
||||
- `works_count` within `--min-works`/`--max-works` (default 20 to 300) to skip hyper-authorship
|
||||
profiles from large collaborations,
|
||||
- an ORCID unless `--no-require-orcid` is given,
|
||||
- every last known institution inside the organization's OpenAlex lineage, which drops merged
|
||||
profiles that also "currently" belong to unrelated institutions,
|
||||
- sorted by `works_count`, then `cited_by_count`.
|
||||
|
||||
Works with more than `--max-authors-per-work` authors (default 30) keep their `Work` node but only
|
||||
the seed researcher's own `AUTHORED` edge, so a single CERN paper cannot add a thousand co-authors.
|
||||
|
||||
## Schema
|
||||
|
||||
Node labels, all keyed by `id` (OpenAlex ids are stored without the `https://openalex.org/` prefix,
|
||||
patents as `<source>:<patent_id>`, projects as `cordis:<id>` / `dfg:<id>`):
|
||||
|
||||
| Label | Properties |
|
||||
| --- | --- |
|
||||
| `Organization` | `name`, `openalex_institution_id` |
|
||||
| `Institution` | `name`, `ror`, `country_code`, `type` |
|
||||
| `Author` | `name`, `orcid`, `works_count`, `cited_by_count`, `h_index`, `i10_index`, `seed` (true for the selected researchers, false for co-authors) |
|
||||
| `Work` | `title`, `year`, `type`, `language`, `cited_by_count`, `authors_count`, `hyperauthorship` |
|
||||
| `Topic` | `name`, `subfield`, `field`, `domain` |
|
||||
| `Project` | `source` (`cordis`/`dfg`), `source_id`, `title`, `acronym`, `start`, `end`, `funding_scheme`, `status`, `ec_max_contribution`, `url` |
|
||||
| `Patent` | `patent_id`, `source` (EPO/USPTO), `title`, `year`, `publication_date`, `kind`, `status`, `country`, `ipc[]`, `assignees[]`, `inventors[]` |
|
||||
| `Funder` | `name` |
|
||||
| `NewsArticle` | `title`, `date`, `url` |
|
||||
| `Company` | `name`, `status`, `registered_office`, `register` |
|
||||
|
||||
Relationships:
|
||||
|
||||
| Relationship | Properties |
|
||||
| --- | --- |
|
||||
| `(Organization)-[:REPRESENTS]->(Institution)` | |
|
||||
| `(Author)-[:MEMBER_OF]->(Organization)` | |
|
||||
| `(Author)-[:AFFILIATED_WITH]->(Institution)` | `years[]`, `last_known` (seed profiles only) |
|
||||
| `(Author)-[:WORKS_ON]->(Topic)` | `score` |
|
||||
| `(Author)-[:AUTHORED]->(Work)` | `position`, `corresponding` |
|
||||
| `(Author)-[:CO_AUTHOR]->(Author)` | `weight`, `first_year`, `last_year` (derived in FalkorDB, `a.id < b.id`) |
|
||||
| `(Work)-[:HAS_TOPIC]->(Topic)`, `(Patent)-[:HAS_TOPIC]->(Topic)`, `(NewsArticle)-[:HAS_TOPIC]->(Topic)` | `score` (works) |
|
||||
| `(Author)-[:CONTRIBUTED_TO]->(Project)` | `via` = `publication_doi` |
|
||||
| `(Author)-[:INVENTOR_OF]->(Patent)` | |
|
||||
| `(Author)-[:FUNDED_BY]->(Funder)` | `publications` |
|
||||
| `(Work)-[:FUNDED_BY]->(Funder)` | only for works that are in the graph |
|
||||
| `(Author)-[:MENTIONED_IN]->(NewsArticle)` | `matching` = `display_name` |
|
||||
| `(Author)-[:OFFICER_OF]->(Company)` | `positions[]`, `matching_method`, `common_name_warning` |
|
||||
|
||||
## Example queries
|
||||
|
||||
The queries for the whole-university graph `ude` are collected in [QUERIES.md](QUERIES.md).
|
||||
The ones below target the small `inse` example graph.
|
||||
|
||||
Paste these into the FalkorDB browser (http://localhost:3000, graph `inse`) or run them with the
|
||||
Python client (`FalkorDB(host="localhost").select_graph("inse").ro_query(...)`).
|
||||
|
||||
Everything around one researcher, for the visual explorer:
|
||||
|
||||
```cypher
|
||||
MATCH (a:Author {seed: true})-[r]-(n) WHERE a.name STARTS WITH 'Nikolai' RETURN a, r, n LIMIT 200
|
||||
```
|
||||
|
||||
Seed researchers per organization with counts per source:
|
||||
|
||||
```cypher
|
||||
MATCH (o:Organization)<-[:MEMBER_OF]-(a:Author)
|
||||
OPTIONAL MATCH (a)-[:AUTHORED]->(w:Work)
|
||||
OPTIONAL MATCH (a)-[:CONTRIBUTED_TO]->(p:Project)
|
||||
OPTIONAL MATCH (a)-[:INVENTOR_OF]->(pt:Patent)
|
||||
OPTIONAL MATCH (a)-[:OFFICER_OF]->(c:Company)
|
||||
RETURN o.name, a.name, count(DISTINCT w) AS works, count(DISTINCT p) AS projects,
|
||||
count(DISTINCT pt) AS patents, count(DISTINCT c) AS companies
|
||||
ORDER BY o.name, a.name
|
||||
```
|
||||
|
||||
Strongest co-authors and where they sit:
|
||||
|
||||
```cypher
|
||||
MATCH (s:Author {seed: true})-[c:CO_AUTHOR]-(o:Author)-[:AFFILIATED_WITH]->(i:Institution)
|
||||
WITH s, o, c, collect(DISTINCT i.name) AS insts ORDER BY c.weight DESC
|
||||
RETURN s.name, collect(o.name + ' (' + toString(c.weight) + ') @ ' + insts[0])[0..5] AS top
|
||||
```
|
||||
|
||||
Topics shared by two of the selected researchers:
|
||||
|
||||
```cypher
|
||||
MATCH (a:Author {seed: true})-[:WORKS_ON]->(t:Topic)<-[:WORKS_ON]-(b:Author {seed: true})
|
||||
WHERE a.id < b.id RETURN a.name, b.name, collect(t.name) AS topics
|
||||
```
|
||||
|
||||
Funders that several selected researchers share:
|
||||
|
||||
```cypher
|
||||
MATCH (a:Author {seed: true})-[:FUNDED_BY]->(f:Funder)<-[:FUNDED_BY]-(b:Author {seed: true})
|
||||
WHERE a.id < b.id
|
||||
RETURN f.name, collect(DISTINCT a.name + ' & ' + b.name) AS pairs ORDER BY size(pairs) DESC LIMIT 5
|
||||
```
|
||||
|
||||
Projects per source and patents with their OpenAlex topics:
|
||||
|
||||
```cypher
|
||||
MATCH (a:Author)-[:CONTRIBUTED_TO]->(p:Project) RETURN p.source, count(DISTINCT p), collect(DISTINCT a.name)
|
||||
```
|
||||
|
||||
```cypher
|
||||
MATCH (a:Author)-[:INVENTOR_OF]->(p:Patent)
|
||||
OPTIONAL MATCH (p)-[:HAS_TOPIC]->(t:Topic)
|
||||
RETURN a.name, p.source, p.year, left(p.title, 60), collect(t.name)[0..2] ORDER BY p.year DESC LIMIT 10
|
||||
```
|
||||
|
||||
Company links, showing which ones rest on a common name:
|
||||
|
||||
```cypher
|
||||
MATCH (a:Author)-[r:OFFICER_OF]->(c:Company)
|
||||
RETURN a.name, r.common_name_warning, count(c) AS companies, collect(c.name)[0..3] AS sample
|
||||
```
|
||||
|
||||
Cross-organization paths through up to two co-authorship hops:
|
||||
|
||||
```cypher
|
||||
MATCH path = (o1:Organization)<-[:MEMBER_OF]-(:Author)-[:CO_AUTHOR*1..2]-(:Author)-[:MEMBER_OF]->(o2:Organization)
|
||||
WHERE o1.name < o2.name RETURN o1.name, o2.name, count(path)
|
||||
```
|
||||
|
||||
## Whole-university graph: `bulk_load.py`
|
||||
|
||||
`load_graph.py` is the per-researcher example. `bulk_load.py` builds the graph for a whole
|
||||
organization by scanning each Elasticsearch source once and streaming into FalkorDB:
|
||||
|
||||
```bash
|
||||
scripts/falkordb/run.sh bulk --graph ude --reset # full UDE cohort, all phases
|
||||
scripts/falkordb/run.sh bulk --graph ude_test --reset --limit-authors 25 # smoke test, a few seconds
|
||||
scripts/falkordb/run.sh bulk --graph ude --phases projects derive # re-run selected phases (idempotent)
|
||||
```
|
||||
|
||||
Phases, in order (`--phases` selects a subset; later phases reload cohort and works from the graph):
|
||||
|
||||
| Phase | Source | Adds |
|
||||
| --- | --- | --- |
|
||||
| `cohort` | active researchers via `build_institution_membership_query` (last known institution + affiliation in the last two years) | `Author` with extra label `Cohort`, `MEMBER_OF`, `AFFILIATED_WITH {years, last_known}`, `WORKS_ON`, `Institution` lineage as `PART_OF` |
|
||||
| `works` | one `scan` of the works index for every work of every cohort researcher | `Work` (incl. `doi`, `is_oa`, `fwci`), every authorship as `AUTHORED`, co-author `Author`s, `AFFILIATED_WITH`, `HAS_TOPIC`, `Venue` + `PUBLISHED_IN`, `Funder` + `FUNDED_BY {awards}` |
|
||||
| `institutions` | `openalex-institutions` index | names, countries and types for institutions that only appeared as lineage ancestors |
|
||||
| `affiliations` | second, lighter scan of the works index | `AUTHORED.institution_ids` (institutions on that authorship) and `Work-[:INVOLVES {authors}]->Institution`, the per-work view that author-level `AFFILIATED_WITH` cannot give |
|
||||
| `classifications` | `work-classifications` index (LLM) | `Work.primary_category`, `pasteur_quadrant`, `applied_orientation_score`, `classification_confidence` |
|
||||
| `projects` | CORDIS publications and DFG project publications by DOI; CORDIS organisations and DFG institutes of the organization; DFG persons by ORCID; project details | `Project {source: cordis/dfg}`, `Work-[:OUTPUT_OF]->Project`, `Institution-[:PARTICIPATES_IN {role, ec_contribution}]->Project`, `Author-[:DFG_ROLE {role}]->Project`, `EuOrganization-[:PARTICIPATES_IN]->Project` (consortium partners) |
|
||||
| `patents` | `org_patents` index (pre-matched by `index_org_patents.py`) | `Patent`, `Author-[:INVENTOR_OF {match_type}]->Patent`, `HAS_TOPIC` |
|
||||
| `news` | `aktuell_postproc` author names matched exactly to cohort display names (the rule the news API uses), articles from `aktuell`, topics from `aktuell_openalex_topics` | `NewsArticle`, `MENTIONED_IN {ambiguous}`, `HAS_TOPIC {keyword}` |
|
||||
| `companies` | `get_company_connections_by_author_id` per researcher, 8 in parallel | `Company`, `OFFICER_OF`; common-name matches are only counted on the Author (`hr_company_matches`, `hr_common_name_warning`) unless `--include-ambiguous-companies` |
|
||||
| `hierarchy` | `get_topic_hierarchy()` | `Domain`, `Field`, `Subfield`, `IN_DOMAIN`, `IN_FIELD`, `IN_SUBFIELD` |
|
||||
| `derive` | Cypher inside FalkorDB | `CO_AUTHOR {weight, first_year, last_year}`, `Author-[:FUNDED_BY {publications}]->Funder`, `Author-[:CONTRIBUTED_TO {works}]->Project` for cohort members |
|
||||
| `profile` | aggregation over the cohort's works | `Institution-[:ACTIVE_IN {level, works, researchers}]->Topic/Subfield/Field/Domain`, the drawable research profile |
|
||||
|
||||
Co-author policy: every authorship is an `AUTHORED` edge, including 5,000-author collaboration
|
||||
papers. `CO_AUTHOR` pairs are derived for all author pairs on works with at most `--pair-cap`
|
||||
authors (default 30) and, on larger works, only for pairs that involve a cohort member. All pairs
|
||||
on the UDE cohort's works would be 2.9 billion edges; the anchored policy gives about 10 million.
|
||||
Edges always point from the smaller to the larger author id, so treat them as undirected.
|
||||
|
||||
Writes go through `GraphWriter`: rows are buffered per label / relationship type and flushed with
|
||||
`UNWIND ... MERGE` in batches of 2,000, node buffers before edge buffers. Cohort profiles use
|
||||
`SET`, co-author stubs use `ON CREATE SET`, so a researcher who is both keeps the full profile.
|
||||
One failing phase is logged and the next phase still runs. The script ends with `BGSAVE`.
|
||||
|
||||
### Result for Universität Duisburg-Essen (2026-09-15)
|
||||
|
||||
Cohort of 6,176 active researchers, every work of every cohort member, no author cap. The load
|
||||
ran in about 12 minutes of pipeline time (works scan 6.5 min, derive 100 s, everything else under
|
||||
a minute each); FalkorDB holds it in 1.04 GB and the RDB snapshot is 264 MB.
|
||||
|
||||
| Nodes | | Relationships | |
|
||||
| --- | --- | --- | --- |
|
||||
| Author | 693,487 (6,176 also `:Cohort`) | AUTHORED | 4,112,809 (2,376,034 with `institution_ids`) |
|
||||
| Work | 204,110 | CO_AUTHOR | 3,782,011 |
|
||||
| Institution | 26,246 | AFFILIATED_WITH / INVOLVES | 1,072,837 / 784,212 |
|
||||
| Venue | 16,534 | HAS_TOPIC | 571,906 |
|
||||
| Funder | 7,493 | FUNDED_BY (work + author level) | 229,219 |
|
||||
| EuOrganization | 5,469 | PUBLISHED_IN | 173,495 |
|
||||
| Topic | 4,516 | WORKS_ON | 27,255 |
|
||||
| NewsArticle | 4,402 | PARTICIPATES_IN | 17,046 |
|
||||
| Project | 3,664 | MENTIONED_IN | 11,251 |
|
||||
| Company | 547 | PART_OF | 11,045 |
|
||||
| Patent | 366 | OUTPUT_OF / CONTRIBUTED_TO | 8,292 / 6,723 |
|
||||
| Subfield / Field / Domain | 252 / 26 / 4 | OFFICER_OF / DFG_ROLE / INVENTOR_OF | 700 / 548 / 367 |
|
||||
| | | ACTIVE_IN (institution research profile) | 4,618 |
|
||||
|
||||
Source coverage of the cohort: all 6,176 have works, 1,741 are linked to projects, 1,925 are
|
||||
mentioned in news, 406 have unambiguous company links, 163 hold indexed patents, 164 were matched to
|
||||
DFG persons through their ORCID. 187,000 works carry an LLM classification.
|
||||
|
||||
Two server behaviours matter at this scale and are handled in the script: FalkorDB caps every
|
||||
result set at `RESULTSET_SIZE` rows (10,000 in the default container), so whole-graph reads are
|
||||
paged (`GraphWriter.ro_all`); and write queries ignore timeouts, which is why the co-author
|
||||
derivation computes pairs in Python and bulk-creates edges instead of running
|
||||
`MATCH ... MERGE` inside the graph (that took over a minute per 2,000 works).
|
||||
|
||||
|
||||
## Caveats worth knowing
|
||||
|
||||
- In the whole-university graph, common-name company matches are not written as edges by default
|
||||
(406 researchers have unambiguous links, the rest only carry `hr_company_matches`).
|
||||
- News and Handelsregister links are name matches, exactly as in the REST API. The `OFFICER_OF`
|
||||
edge carries `common_name_warning`; a researcher named Thomas Kaiser gets 92 companies with the
|
||||
flag set, Ahmet Karkar gets one without it.
|
||||
- Patents are matched by inventor name with the institution guard from `patents.authors.logic`;
|
||||
the backend logs `search_completeness=truncated_inconclusive` for common names.
|
||||
- The project bridge is DOI based: a researcher is linked to every CORDIS/DFG project that lists one
|
||||
of their publications, regardless of author position.
|
||||
- OpenAlex profiles can be merged across institutions. The lineage filter above avoids most of
|
||||
them for the automatic selection, `--author-id` takes whatever you give it.
|
||||
- `Author.topics` in the mirror carry a `score` where OpenAlex has a `count`; the value is stored
|
||||
as-is on `WORKS_ON`.
|
||||
|
||||
## Running without Docker
|
||||
|
||||
Create a Python 3.12 environment with the service dependencies (`pip install -e` is not set up, so
|
||||
install `fastapi httpx pydantic pydantic-settings sqlmodel python-dotenv pyyaml pyjwt openai pandas
|
||||
pypdf sentence-transformers torch` matching `pyproject.toml`) plus `falkordb`, then run
|
||||
`python scripts/falkordb/load_graph.py` from `service/`. The script locates `src/main/inse` and its
|
||||
`.env` relative to its own path.
|
||||
@@ -0,0 +1,636 @@
|
||||
"""
|
||||
load_graph.py — Minimal FalkorDB example for the INSE backend.
|
||||
|
||||
Builds a small knowledge graph around a couple of researchers from the predefined
|
||||
("default") organizations in src/data/predefined_accounts.json, using only the
|
||||
backend's existing data-source logic (everything reads the INSE Elasticsearch mirrors):
|
||||
|
||||
OpenAlex authors, works, topics, institutions -> inse.authors.v2 / inse.works.v2 / inse.institutions.v2
|
||||
EPO + USPTO patents -> inse.patents.authors.logic
|
||||
CORDIS (EU) + DFG projects, via publication DOIs -> inse.works.logic + inse.projects.*
|
||||
Funders of the author's funded publications -> inse.funders.logic
|
||||
News mentions (UDE "aktuell" + CC-News) -> inse.news.logic
|
||||
Handelsregister company officer matches -> inse.company_connections.logic
|
||||
|
||||
The collected nodes/edges are written to FalkorDB with batched UNWIND ... MERGE
|
||||
queries, and CO_AUTHOR edges are then derived inside the graph with one Cypher query.
|
||||
|
||||
Usage (see run.sh for running inside the service image):
|
||||
python scripts/falkordb/load_graph.py # 2 researchers per default org
|
||||
python scripts/falkordb/load_graph.py --organization "Duisburg" --per-org 3
|
||||
python scripts/falkordb/load_graph.py --author-id A5040796987 --author-id A5119657791
|
||||
python scripts/falkordb/load_graph.py --reset --dump /tmp/graph.json --skip news --skip companies
|
||||
|
||||
FalkorDB connection: --falkordb-host/--falkordb-port/--falkordb-password or the
|
||||
FALKORDB_HOST / FALKORDB_PORT / FALKORDB_PASSWORD environment variables.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import asyncio
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import time
|
||||
from collections import Counter, defaultdict
|
||||
from dataclasses import dataclass, field
|
||||
from datetime import date, datetime
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
# --- locate the backend package (works from the repo checkout and inside the service image) ---
|
||||
_current_dir = Path(__file__).resolve().parent
|
||||
_service_dir = _current_dir.parent.parent
|
||||
_src_main = _service_dir / "src" / "main"
|
||||
if not (_src_main / "inse").is_dir():
|
||||
_src_main = Path(os.environ.get("INSE_SRC_DIR", "/home"))
|
||||
sys.path.insert(0, str(_src_main))
|
||||
|
||||
from dotenv import load_dotenv # noqa: E402
|
||||
|
||||
_env_file = _src_main / "inse" / ".env"
|
||||
if _env_file.exists():
|
||||
load_dotenv(dotenv_path=_env_file)
|
||||
|
||||
# inse.config reads the .env at import time, so these imports must come after load_dotenv.
|
||||
from inse.authors.institution_membership_query import ( # noqa: E402
|
||||
build_institution_membership_query,
|
||||
current_affiliation_year_cutoff,
|
||||
)
|
||||
from inse.authors.v2.service import get_author_by_id_strict_or_raise, search_authors # noqa: E402
|
||||
from inse.company_connections.logic import get_company_connections_by_author_id # noqa: E402
|
||||
from inse.funders.logic import get_funders_by_author_id # noqa: E402
|
||||
from inse.institutions.v2.service import get_institution_by_id # noqa: E402
|
||||
from inse.models.openalex.author import Author # noqa: E402
|
||||
from inse.news.logic import get_news_by_author # noqa: E402
|
||||
from inse.patents.authors.logic import get_patents_by_author_id # noqa: E402
|
||||
from inse.projects.eu_cordis_projects_client import get_enriched_cordis_project_by_id # noqa: E402
|
||||
from inse.projects.projects_search_client import ( # noqa: E402
|
||||
get_cordis_eu_project_ids_by_dois,
|
||||
get_dfg_project_by_id,
|
||||
get_dfg_project_ids_by_dois,
|
||||
)
|
||||
from inse.works.logic import get_publication_dois_of_author # noqa: E402
|
||||
from inse.works.v2.service import get_author_works # noqa: E402
|
||||
|
||||
logger = logging.getLogger("falkordb.load_graph")
|
||||
|
||||
OPENALEX_PREFIX = "https://openalex.org/"
|
||||
PREDEFINED_ACCOUNTS = _src_main.parent / "data" / "predefined_accounts.json"
|
||||
SOURCES = ("works", "projects", "patents", "funders", "news", "companies")
|
||||
_IDENT = re.compile(r"^[A-Z][A-Za-z_]*$")
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- helpers
|
||||
def short_id(raw: str | None) -> str | None:
|
||||
"""'https://openalex.org/A123' -> 'A123' (OpenAlex ids are stored as URLs in ES)."""
|
||||
if not raw:
|
||||
return None
|
||||
return raw.strip().removeprefix(OPENALEX_PREFIX)
|
||||
|
||||
|
||||
def raw_doi(doi: str) -> str:
|
||||
for prefix in ("https://doi.org/", "http://doi.org/", "http://dx.doi.org/"):
|
||||
if doi.startswith(prefix):
|
||||
return doi[len(prefix):]
|
||||
return doi
|
||||
|
||||
|
||||
def _scalar(value: Any) -> Any:
|
||||
if isinstance(value, (date, datetime)):
|
||||
return value.isoformat()
|
||||
if isinstance(value, str):
|
||||
return value[:2000]
|
||||
if isinstance(value, (bool, int, float)):
|
||||
return value
|
||||
return str(value)
|
||||
|
||||
|
||||
def clean_props(props: dict[str, Any]) -> dict[str, Any]:
|
||||
"""FalkorDB properties must be scalars or lists of scalars; drop None/dicts."""
|
||||
cleaned: dict[str, Any] = {}
|
||||
for key, value in props.items():
|
||||
if value is None or isinstance(value, dict):
|
||||
continue
|
||||
if isinstance(value, (list, tuple, set)):
|
||||
cleaned[key] = [_scalar(v) for v in value if v is not None and not isinstance(v, dict)]
|
||||
else:
|
||||
cleaned[key] = _scalar(value)
|
||||
return cleaned
|
||||
|
||||
|
||||
@dataclass
|
||||
class GraphBatch:
|
||||
"""In-memory node/edge accumulator. First writer of a property wins, so seed
|
||||
authors (hydrated first) keep their full profile when they reappear as co-authors."""
|
||||
|
||||
nodes: dict[tuple[str, str], dict[str, Any]] = field(default_factory=dict)
|
||||
edges: dict[tuple[str, str, str, str, str], dict[str, Any]] = field(default_factory=dict)
|
||||
|
||||
def node(self, label: str, node_id: str | None, **props: Any) -> None:
|
||||
if not node_id:
|
||||
return
|
||||
props = clean_props(props)
|
||||
existing = self.nodes.setdefault((label, node_id), {})
|
||||
for key, value in props.items():
|
||||
existing.setdefault(key, value)
|
||||
|
||||
def edge(self, src_label: str, src: str | None, rel: str, dst_label: str, dst: str | None, **props: Any) -> None:
|
||||
if not src or not dst:
|
||||
return
|
||||
props = clean_props(props)
|
||||
existing = self.edges.setdefault((src_label, src, rel, dst_label, dst), {})
|
||||
for key, value in props.items():
|
||||
existing.setdefault(key, value)
|
||||
|
||||
def has_node(self, label: str, node_id: str | None) -> bool:
|
||||
return bool(node_id) and (label, node_id) in self.nodes
|
||||
|
||||
def summary(self) -> tuple[Counter, Counter]:
|
||||
return (
|
||||
Counter(label for label, _ in self.nodes),
|
||||
Counter(rel for _, _, rel, _, _ in self.edges),
|
||||
)
|
||||
|
||||
def to_json(self) -> dict[str, Any]:
|
||||
return {
|
||||
"nodes": [{"label": l, "id": i, "props": p} for (l, i), p in self.nodes.items()],
|
||||
"edges": [
|
||||
{"src_label": sl, "src": s, "rel": r, "dst_label": dl, "dst": d, "props": p}
|
||||
for (sl, s, r, dl, d), p in self.edges.items()
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
def add_topic(batch: GraphBatch, topic: Any) -> str | None:
|
||||
"""Topic node from an OpenAlex WorkTopic-like object (works, authors, patents, news)."""
|
||||
tid = short_id(getattr(topic, "id", None))
|
||||
if not tid:
|
||||
return None
|
||||
subfield = getattr(topic, "subfield", None)
|
||||
field_ = getattr(topic, "var_field", None) or getattr(topic, "field", None)
|
||||
domain = getattr(topic, "domain", None)
|
||||
batch.node(
|
||||
"Topic",
|
||||
tid,
|
||||
name=getattr(topic, "display_name", None),
|
||||
subfield=getattr(subfield, "display_name", None),
|
||||
field=getattr(field_, "display_name", None),
|
||||
domain=getattr(domain, "display_name", None),
|
||||
)
|
||||
return tid
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- organizations
|
||||
def load_default_organizations() -> list[dict[str, str]]:
|
||||
"""The predefined organizations seeded at startup (auth.service.create_predefined_accounts)."""
|
||||
with open(PREDEFINED_ACCOUNTS, encoding="utf-8") as fh:
|
||||
data = json.load(fh)
|
||||
return [
|
||||
{"name": org["name"], "institution_id": org["openalex_institution_id"]}
|
||||
for org in data.get("organizations", [])
|
||||
if org.get("openalex_institution_id")
|
||||
]
|
||||
|
||||
|
||||
def select_organizations(orgs: list[dict[str, str]], wanted: list[str]) -> list[dict[str, str]]:
|
||||
if not wanted:
|
||||
return orgs
|
||||
selected = []
|
||||
for term in wanted:
|
||||
term_l = term.lower()
|
||||
matches = [o for o in orgs if term_l in o["name"].lower() or term_l == o["institution_id"].lower()]
|
||||
if not matches:
|
||||
raise SystemExit(f"No default organization matches {term!r}. Known: {[o['name'] for o in orgs]}")
|
||||
selected.extend(m for m in matches if m not in selected)
|
||||
return selected
|
||||
|
||||
|
||||
async def ensure_organization_nodes(batch: GraphBatch, org: dict[str, str]) -> None:
|
||||
"""Organization (from predefined_accounts.json) + its OpenAlex institution."""
|
||||
if batch.has_node("Organization", org["name"]):
|
||||
return
|
||||
institution = await get_institution_by_id(org["institution_id"])
|
||||
batch.node("Organization", org["name"], name=org["name"], openalex_institution_id=org["institution_id"])
|
||||
batch.node(
|
||||
"Institution", org["institution_id"],
|
||||
name=getattr(institution, "display_name", None) or org["name"],
|
||||
ror=getattr(institution, "ror", None),
|
||||
country_code=getattr(institution, "country_code", None),
|
||||
type=str(institution.type) if getattr(institution, "type", None) else None,
|
||||
)
|
||||
batch.edge("Organization", org["name"], "REPRESENTS", "Institution", org["institution_id"])
|
||||
|
||||
|
||||
def organization_of(author: Author, orgs: list[dict[str, str]]) -> dict[str, str] | None:
|
||||
"""Default organization whose institution is among the author's last known institutions."""
|
||||
last_known = {short_id(i.id) for i in (author.last_known_institutions or []) if i.id}
|
||||
return next((org for org in orgs if org["institution_id"] in last_known), None)
|
||||
|
||||
|
||||
async def pick_seed_authors(
|
||||
institution_id: str, per_org: int, min_works: int, max_works: int, require_orcid: bool
|
||||
) -> list[Author]:
|
||||
"""Seed researchers of an institution.
|
||||
|
||||
Reuses the backend's active-cohort membership query (last known institution plus an
|
||||
affiliation since the current year minus two, the same rule the app uses for
|
||||
"currently belongs to institution"), then narrows the candidates so the example graph
|
||||
stays small and well disambiguated:
|
||||
* works_count within [min_works, max_works] -> skips hyper-authorship profiles
|
||||
* an ORCID (optional) -> better-disambiguated OpenAlex profiles
|
||||
* every last-known institution inside the institution's OpenAlex lineage
|
||||
-> drops merged profiles that also "currently" belong to unrelated institutions
|
||||
"""
|
||||
institution_url = f"{OPENALEX_PREFIX}{institution_id}"
|
||||
filters: list[dict[str, Any]] = [
|
||||
build_institution_membership_query(institution_id, year_mode="from", year=current_affiliation_year_cutoff()),
|
||||
{"range": {"works_count": {"gte": min_works, "lte": max_works}}},
|
||||
]
|
||||
if require_orcid:
|
||||
filters.append({"exists": {"field": "orcid"}})
|
||||
page = await search_authors(
|
||||
page=0,
|
||||
size=max(20, per_org * 20),
|
||||
query={"bool": {"filter": filters}},
|
||||
sort=[{"works_count": {"order": "desc"}}, {"cited_by_count": {"order": "desc"}}],
|
||||
)
|
||||
|
||||
def within_lineage(author: Author) -> bool:
|
||||
return all(
|
||||
inst.id == institution_url or institution_url in (inst.lineage or [])
|
||||
for inst in (author.last_known_institutions or [])
|
||||
)
|
||||
|
||||
return [author for author in page.elements if within_lineage(author)][:per_org]
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- collectors
|
||||
def collect_author_profile(batch: GraphBatch, author: Author, org_name: str | None) -> str:
|
||||
aid = short_id(author.id)
|
||||
stats = author.summary_stats
|
||||
batch.node(
|
||||
"Author",
|
||||
aid,
|
||||
name=author.display_name,
|
||||
orcid=author.orcid,
|
||||
works_count=author.works_count,
|
||||
cited_by_count=author.cited_by_count,
|
||||
h_index=getattr(stats, "h_index", None),
|
||||
i10_index=getattr(stats, "i10_index", None),
|
||||
seed=True,
|
||||
)
|
||||
if org_name:
|
||||
batch.edge("Author", aid, "MEMBER_OF", "Organization", org_name)
|
||||
|
||||
last_known = {short_id(i.id) for i in (author.last_known_institutions or []) if i.id}
|
||||
for affiliation in author.affiliations or []:
|
||||
inst = affiliation.institution
|
||||
iid = short_id(inst.id) if inst else None
|
||||
if not iid:
|
||||
continue
|
||||
batch.node("Institution", iid, name=inst.display_name, country_code=inst.country_code, type=inst.type, ror=inst.ror)
|
||||
batch.edge(
|
||||
"Author", aid, "AFFILIATED_WITH", "Institution", iid,
|
||||
years=sorted(affiliation.years or []),
|
||||
last_known=iid in last_known,
|
||||
)
|
||||
for topic in author.topics or []:
|
||||
tid = add_topic(batch, topic)
|
||||
if tid:
|
||||
batch.edge("Author", aid, "WORKS_ON", "Topic", tid, score=getattr(topic, "score", None))
|
||||
return aid
|
||||
|
||||
|
||||
async def collect_works(batch: GraphBatch, aid: str, max_works: int, max_authors_per_work: int) -> int:
|
||||
page = await get_author_works(aid, page=0, size=max_works)
|
||||
for work in page.elements:
|
||||
wid = short_id(work.id)
|
||||
if not wid:
|
||||
continue
|
||||
authorships = work.authorships or []
|
||||
hyper = len(authorships) > max_authors_per_work
|
||||
batch.node(
|
||||
"Work", wid,
|
||||
title=work.title or work.display_name,
|
||||
year=work.publication_year,
|
||||
type=work.type,
|
||||
language=work.language,
|
||||
cited_by_count=work.cited_by_count,
|
||||
authors_count=len(authorships),
|
||||
hyperauthorship=hyper,
|
||||
)
|
||||
for topic in work.topics or []:
|
||||
tid = add_topic(batch, topic)
|
||||
if tid:
|
||||
batch.edge("Work", wid, "HAS_TOPIC", "Topic", tid, score=topic.score)
|
||||
for authorship in authorships:
|
||||
author = authorship.author
|
||||
cid = short_id(author.id) if author else None
|
||||
if not cid or (hyper and cid != aid):
|
||||
continue # for hyper-authorship works only keep the seed author's own edge
|
||||
batch.node("Author", cid, name=author.display_name, orcid=author.orcid, seed=False)
|
||||
batch.edge(
|
||||
"Author", cid, "AUTHORED", "Work", wid,
|
||||
position=authorship.author_position,
|
||||
corresponding=authorship.is_corresponding,
|
||||
)
|
||||
for inst in authorship.institutions or []:
|
||||
iid = short_id(inst.id)
|
||||
if iid:
|
||||
batch.node("Institution", iid, name=inst.display_name, country_code=inst.country_code, type=inst.type)
|
||||
batch.edge("Author", cid, "AFFILIATED_WITH", "Institution", iid)
|
||||
return len(page.elements)
|
||||
|
||||
|
||||
async def collect_projects(batch: GraphBatch, aid: str) -> int:
|
||||
"""Author -> project bridge used elsewhere in the backend: the author's publication DOIs
|
||||
are looked up in the CORDIS publication index and in the DFG projects' publication lists."""
|
||||
dois = await get_publication_dois_of_author(aid)
|
||||
if not dois:
|
||||
return 0
|
||||
doi_variants = sorted({v for d in dois for v in (d, raw_doi(d), raw_doi(d).lower())})
|
||||
cordis_ids = await get_cordis_eu_project_ids_by_dois(dois)
|
||||
dfg_ids = await get_dfg_project_ids_by_dois(doi_variants)
|
||||
|
||||
for pid in cordis_ids:
|
||||
node_id = f"cordis:{pid}"
|
||||
details = await get_enriched_cordis_project_by_id(str(pid))
|
||||
batch.node(
|
||||
"Project", node_id,
|
||||
source="cordis", source_id=str(pid),
|
||||
title=getattr(details, "title", None),
|
||||
acronym=getattr(details, "acronym", None),
|
||||
start=getattr(details, "start_date", None),
|
||||
end=getattr(details, "end_date", None),
|
||||
funding_scheme=getattr(details, "funding_scheme", None),
|
||||
status=getattr(details, "status", None),
|
||||
ec_max_contribution=getattr(details, "ec_max_contribution", None),
|
||||
)
|
||||
batch.edge("Author", aid, "CONTRIBUTED_TO", "Project", node_id, via="publication_doi")
|
||||
for pid in dfg_ids:
|
||||
node_id = f"dfg:{pid}"
|
||||
details = await get_dfg_project_by_id(str(pid))
|
||||
batch.node(
|
||||
"Project", node_id,
|
||||
source="dfg", source_id=str(pid),
|
||||
title=getattr(details, "title_en", None) or getattr(details, "title_de", None),
|
||||
start=getattr(details, "funding_start", None),
|
||||
end=getattr(details, "funding_end", None),
|
||||
funding_scheme=getattr(details, "funding_type_en", None) or getattr(details, "funding_type_de", None),
|
||||
url=getattr(details, "page_url", None) or getattr(details, "link", None),
|
||||
)
|
||||
batch.edge("Author", aid, "CONTRIBUTED_TO", "Project", node_id, via="publication_doi")
|
||||
return len(cordis_ids) + len(dfg_ids)
|
||||
|
||||
|
||||
async def collect_patents(batch: GraphBatch, aid: str) -> int:
|
||||
response = await get_patents_by_author_id(aid)
|
||||
for patent in response.patents:
|
||||
pid = f"{patent.source}:{patent.patent_id}"
|
||||
year = int(patent.publication_year) if patent.publication_year and patent.publication_year.isdigit() else None
|
||||
batch.node(
|
||||
"Patent", pid,
|
||||
patent_id=patent.patent_id, source=patent.source,
|
||||
title=patent.title or patent.title_en or patent.title_de,
|
||||
year=year, publication_date=patent.publication_date,
|
||||
kind=patent.kind, status=patent.status, country=patent.country,
|
||||
ipc=patent.ipc, assignees=patent.assignees, inventors=patent.inventors,
|
||||
)
|
||||
batch.edge("Author", aid, "INVENTOR_OF", "Patent", pid)
|
||||
for tag in patent.openalex_topics:
|
||||
tid = short_id(tag.topic_id)
|
||||
if tid:
|
||||
batch.node("Topic", tid, name=tag.topic_display_name, field=tag.field_name, domain=tag.domain_name)
|
||||
batch.edge("Patent", pid, "HAS_TOPIC", "Topic", tid)
|
||||
return response.patent_count
|
||||
|
||||
|
||||
async def collect_funders(batch: GraphBatch, aid: str) -> int:
|
||||
response = await get_funders_by_author_id(aid)
|
||||
for funder in response.funders:
|
||||
fid = short_id(funder.funder_id) or f"name:{funder.funder_name}"
|
||||
batch.node("Funder", fid, name=funder.funder_name)
|
||||
batch.edge("Author", aid, "FUNDED_BY", "Funder", fid, publications=funder.publication_count)
|
||||
ids = funder.publication_ids
|
||||
for wid_raw in ids.first + ids.middle + ids.last + ids.unknown:
|
||||
wid = short_id(wid_raw)
|
||||
if batch.has_node("Work", wid): # only link works we already loaded
|
||||
batch.edge("Work", wid, "FUNDED_BY", "Funder", fid)
|
||||
return response.funder_count
|
||||
|
||||
|
||||
async def collect_news(batch: GraphBatch, aid: str, max_news: int) -> int:
|
||||
page = await get_news_by_author(aid, page=1, page_size=max_news)
|
||||
for article in page.results:
|
||||
batch.node("NewsArticle", article.id, title=article.maintitle, date=article.date, url=article.url)
|
||||
batch.edge("Author", aid, "MENTIONED_IN", "NewsArticle", article.id, matching="display_name")
|
||||
for topic in article.topics or []:
|
||||
tid = short_id(topic.id)
|
||||
if tid:
|
||||
batch.node("Topic", tid, name=topic.display_name, subfield=topic.subfield_name, field=topic.field_name, domain=topic.domain_name)
|
||||
batch.edge("NewsArticle", article.id, "HAS_TOPIC", "Topic", tid)
|
||||
return page.total
|
||||
|
||||
|
||||
async def collect_companies(batch: GraphBatch, aid: str) -> int:
|
||||
response = await get_company_connections_by_author_id(aid)
|
||||
for company in response.connections:
|
||||
cid = company.company_number or company.native_company_number or f"name:{company.company_name}"
|
||||
batch.node(
|
||||
"Company", cid,
|
||||
name=company.company_name, status=company.company_status,
|
||||
registered_office=company.registered_office,
|
||||
register=" ".join(p for p in (company.register_art, company.register_nummer) if p) or None,
|
||||
)
|
||||
batch.edge(
|
||||
"Author", aid, "OFFICER_OF", "Company", cid,
|
||||
positions=[o.position for o in company.matched_officers if o.position],
|
||||
matching_method=response.matching_method,
|
||||
common_name_warning=response.common_name_warning,
|
||||
)
|
||||
return response.company_count
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- FalkorDB sink
|
||||
def _chunks(rows: list[dict[str, Any]], size: int):
|
||||
for start in range(0, len(rows), size):
|
||||
yield rows[start:start + size]
|
||||
|
||||
|
||||
def write_to_falkordb(batch: GraphBatch, args: argparse.Namespace) -> None:
|
||||
from falkordb import FalkorDB
|
||||
from redis.exceptions import ResponseError
|
||||
|
||||
db = FalkorDB(host=args.falkordb_host, port=args.falkordb_port, password=args.falkordb_password)
|
||||
if args.reset and args.graph in db.list_graphs():
|
||||
db.select_graph(args.graph).delete()
|
||||
logger.info("Deleted existing graph %r", args.graph)
|
||||
graph = db.select_graph(args.graph)
|
||||
|
||||
labels = sorted({label for label, _ in batch.nodes})
|
||||
for label in labels:
|
||||
try:
|
||||
graph.create_node_range_index(label, "id")
|
||||
except ResponseError as exc:
|
||||
if "already indexed" not in str(exc):
|
||||
raise
|
||||
|
||||
nodes_by_label: dict[str, list[dict[str, Any]]] = defaultdict(list)
|
||||
for (label, node_id), props in batch.nodes.items():
|
||||
nodes_by_label[label].append({"id": node_id, "props": props})
|
||||
for label, rows in nodes_by_label.items():
|
||||
assert _IDENT.match(label), label
|
||||
for chunk in _chunks(rows, args.batch_size):
|
||||
graph.query(f"UNWIND $rows AS r MERGE (n:{label} {{id: r.id}}) SET n += r.props", {"rows": chunk})
|
||||
|
||||
edges_by_type: dict[tuple[str, str, str], list[dict[str, Any]]] = defaultdict(list)
|
||||
for (src_label, src, rel, dst_label, dst), props in batch.edges.items():
|
||||
edges_by_type[(src_label, rel, dst_label)].append({"src": src, "dst": dst, "props": props})
|
||||
for (src_label, rel, dst_label), rows in edges_by_type.items():
|
||||
assert _IDENT.match(src_label) and _IDENT.match(rel) and _IDENT.match(dst_label)
|
||||
for chunk in _chunks(rows, args.batch_size):
|
||||
graph.query(
|
||||
f"UNWIND $rows AS r "
|
||||
f"MATCH (a:{src_label} {{id: r.src}}), (b:{dst_label} {{id: r.dst}}) "
|
||||
f"MERGE (a)-[e:{rel}]->(b) SET e += r.props",
|
||||
{"rows": chunk},
|
||||
)
|
||||
|
||||
if not args.no_coauthor_edges:
|
||||
# Derive co-authorship inside the graph instead of in Python (this is the part the
|
||||
# in-service CollaborationGraph API currently leaves to the client).
|
||||
result = graph.query(
|
||||
"MATCH (a:Author)-[:AUTHORED]->(w:Work)<-[:AUTHORED]-(b:Author) "
|
||||
"WHERE a.id < b.id "
|
||||
"WITH a, b, count(DISTINCT w) AS n, min(w.year) AS first_year, max(w.year) AS last_year "
|
||||
"MERGE (a)-[c:CO_AUTHOR]->(b) "
|
||||
"SET c.weight = n, c.first_year = first_year, c.last_year = last_year"
|
||||
)
|
||||
logger.info("CO_AUTHOR edges created: %d", int(result.relationships_created or 0))
|
||||
|
||||
stats = graph.ro_query(
|
||||
"MATCH (n) WITH count(n) AS nodes MATCH ()-[r]->() RETURN nodes, count(r)"
|
||||
).result_set
|
||||
logger.info("Graph %r now holds %s nodes and %s relationships", args.graph, *stats[0])
|
||||
|
||||
seeds = graph.ro_query(
|
||||
"MATCH (s:Author {seed: true}) "
|
||||
"OPTIONAL MATCH (s)-[c:CO_AUTHOR]-(o:Author) "
|
||||
"WITH s, o, c ORDER BY c.weight DESC "
|
||||
"WITH s, collect(o.name + ' (' + toString(c.weight) + ')')[0..3] AS top "
|
||||
"RETURN s.id, s.name, top ORDER BY s.name"
|
||||
).result_set
|
||||
for row in seeds:
|
||||
logger.info(" %s %-32s strongest co-authors: %s", row[0], row[1], ", ".join(row[2]) or "-")
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- main
|
||||
async def run_source(name: str, coro, status: dict[str, str]) -> None:
|
||||
started = time.perf_counter()
|
||||
try:
|
||||
count = await coro
|
||||
status[name] = f"{count} ({(time.perf_counter() - started) * 1000:.0f}ms)"
|
||||
except Exception as exc: # one failing source must not abort the whole load
|
||||
logger.warning("source %-9s failed: %s: %s", name, type(exc).__name__, exc)
|
||||
status[name] = "error"
|
||||
|
||||
|
||||
async def main(args: argparse.Namespace) -> None:
|
||||
batch = GraphBatch()
|
||||
skipped = set(args.skip)
|
||||
seeds: list[tuple[Author, str | None]] = []
|
||||
default_orgs = load_default_organizations()
|
||||
|
||||
if args.author_id:
|
||||
for raw in args.author_id:
|
||||
author = await get_author_by_id_strict_or_raise(short_id(raw))
|
||||
org = organization_of(author, default_orgs)
|
||||
if org:
|
||||
await ensure_organization_nodes(batch, org)
|
||||
seeds.append((author, org["name"] if org else None))
|
||||
else:
|
||||
for org in select_organizations(default_orgs, args.organization):
|
||||
await ensure_organization_nodes(batch, org)
|
||||
authors = await pick_seed_authors(
|
||||
org["institution_id"], args.per_org, args.min_works, args.max_works, args.require_orcid
|
||||
)
|
||||
logger.info("%s (%s): %s", org["name"], org["institution_id"], ", ".join(f"{a.display_name} [{short_id(a.id)}]" for a in authors) or "no authors found")
|
||||
seeds.extend((author, org["name"]) for author in authors)
|
||||
|
||||
if not seeds:
|
||||
raise SystemExit("No seed researchers selected.")
|
||||
|
||||
seed_ids = [collect_author_profile(batch, author, org_name) for author, org_name in seeds]
|
||||
|
||||
for (author, _), aid in zip(seeds, seed_ids):
|
||||
logger.info("Collecting sources for %s [%s] ...", author.display_name, aid)
|
||||
status: dict[str, str] = {}
|
||||
if "works" not in skipped:
|
||||
await run_source("works", collect_works(batch, aid, args.works, args.max_authors_per_work), status)
|
||||
if "projects" not in skipped:
|
||||
await run_source("projects", collect_projects(batch, aid), status)
|
||||
if "patents" not in skipped:
|
||||
await run_source("patents", collect_patents(batch, aid), status)
|
||||
if "funders" not in skipped:
|
||||
await run_source("funders", collect_funders(batch, aid), status)
|
||||
if "news" not in skipped:
|
||||
await run_source("news", collect_news(batch, aid, args.news), status)
|
||||
if "companies" not in skipped:
|
||||
await run_source("companies", collect_companies(batch, aid), status)
|
||||
logger.info(" %s", " ".join(f"{k}={v}" for k, v in status.items()))
|
||||
|
||||
node_counts, edge_counts = batch.summary()
|
||||
logger.info("Collected nodes: %s", dict(node_counts))
|
||||
logger.info("Collected edges: %s", dict(edge_counts))
|
||||
|
||||
if args.dump:
|
||||
Path(args.dump).write_text(json.dumps(batch.to_json(), ensure_ascii=False, indent=1), encoding="utf-8")
|
||||
logger.info("Wrote %s", args.dump)
|
||||
|
||||
if args.no_write:
|
||||
return
|
||||
write_to_falkordb(batch, args)
|
||||
|
||||
|
||||
def parse_args() -> argparse.Namespace:
|
||||
parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
sel = parser.add_argument_group("researcher selection")
|
||||
sel.add_argument("--organization", action="append", default=[], metavar="NAME_OR_ID",
|
||||
help="restrict to default organization(s) by name substring or OpenAlex institution id (repeatable)")
|
||||
sel.add_argument("--per-org", type=int, default=2, help="seed researchers per organization (default 2)")
|
||||
sel.add_argument("--min-works", type=int, default=20, help="minimum works_count for seed selection")
|
||||
sel.add_argument("--max-works", type=int, default=300, help="maximum works_count for seed selection (skips hyper-authorship profiles)")
|
||||
sel.add_argument("--require-orcid", action=argparse.BooleanOptionalAction, default=True,
|
||||
help="only seed researchers with an ORCID (default on)")
|
||||
sel.add_argument("--author-id", action="append", default=[], metavar="OPENALEX_ID",
|
||||
help="explicit seed researcher(s), e.g. A5040796987 (repeatable; overrides organization selection)")
|
||||
src = parser.add_argument_group("sources")
|
||||
src.add_argument("--works", type=int, default=40, help="max works per researcher (default 40)")
|
||||
src.add_argument("--max-authors-per-work", type=int, default=30, help="skip co-author edges for works with more authors")
|
||||
src.add_argument("--news", type=int, default=20, help="max news articles per researcher")
|
||||
src.add_argument("--skip", action="append", default=[], choices=SOURCES, help="skip a source (repeatable)")
|
||||
out = parser.add_argument_group("output")
|
||||
out.add_argument("--falkordb-host", default=os.environ.get("FALKORDB_HOST", "localhost"))
|
||||
out.add_argument("--falkordb-port", type=int, default=int(os.environ.get("FALKORDB_PORT", "6379")))
|
||||
out.add_argument("--falkordb-password", default=os.environ.get("FALKORDB_PASSWORD") or None)
|
||||
out.add_argument("--graph", default=os.environ.get("FALKORDB_GRAPH", "inse"), help="graph name (default inse)")
|
||||
out.add_argument("--reset", action="store_true", help="delete the graph before loading")
|
||||
out.add_argument("--no-coauthor-edges", action="store_true", help="do not derive CO_AUTHOR edges")
|
||||
out.add_argument("--batch-size", type=int, default=500)
|
||||
out.add_argument("--dump", metavar="PATH", help="also write the collected nodes/edges as JSON")
|
||||
out.add_argument("--no-write", action="store_true", help="collect only (useful with --dump), do not touch FalkorDB")
|
||||
parser.add_argument("-v", "--verbose", action="store_true", help="show backend/httpx logs")
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
cli_args = parse_args()
|
||||
logging.basicConfig(level=logging.INFO, format="%(levelname)s %(message)s")
|
||||
if not cli_args.verbose:
|
||||
# Some backend modules pin their own logger level, so filter at the handler instead.
|
||||
for handler in logging.getLogger().handlers:
|
||||
handler.addFilter(lambda record: record.levelno >= logging.WARNING or record.name.startswith("falkordb"))
|
||||
asyncio.run(main(cli_args))
|
||||
@@ -0,0 +1,2 @@
|
||||
# Extra dependency for scripts/falkordb on top of the service image / pyproject.
|
||||
falkordb~=1.7
|
||||
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
# Run load_graph.py inside the inse-service image, which already has every backend
|
||||
# dependency (torch/sentence-transformers included), and talk to FalkorDB on the host.
|
||||
#
|
||||
# scripts/falkordb/run.sh # 2 researchers per default organization
|
||||
# scripts/falkordb/run.sh --reset --organization Duisburg --per-org 3
|
||||
# scripts/falkordb/run.sh --author-id A5040796987 --author-id A5119657791
|
||||
# scripts/falkordb/run.sh bulk --graph ude --reset # whole-university graph (bulk_load.py)
|
||||
#
|
||||
# Env: INSE_IMAGE (default inse-service:1.0.0, built by ./gradlew :service:createImage),
|
||||
# FALKORDB_HOST (default host.docker.internal), FALKORDB_PORT, FALKORDB_PASSWORD, FALKORDB_GRAPH.
|
||||
set -euo pipefail
|
||||
|
||||
SERVICE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
# First argument "bulk" selects the whole-university loader (bulk_load.py); otherwise load_graph.py runs.
|
||||
SCRIPT="load_graph.py"
|
||||
if [ "${1:-}" = "bulk" ]; then SCRIPT="bulk_load.py"; shift; fi
|
||||
IMAGE="${INSE_IMAGE:-inse-service:1.0.0}"
|
||||
TTY_FLAGS=""
|
||||
if [ -t 0 ] && [ -t 1 ]; then TTY_FLAGS="-it"; fi
|
||||
# Match the image's platform (the Gradle build targets amd64), avoiding Docker's mismatch warning on arm64 hosts.
|
||||
PLATFORM="$(docker image inspect --format '{{.Os}}/{{.Architecture}}' "$IMAGE" 2>/dev/null || true)"
|
||||
PLATFORM_FLAGS=""
|
||||
if [ -n "$PLATFORM" ]; then PLATFORM_FLAGS="--platform $PLATFORM"; fi
|
||||
|
||||
exec docker run --rm $TTY_FLAGS $PLATFORM_FLAGS \
|
||||
-v "$SERVICE_DIR/src/main:/home" \
|
||||
-v "$SERVICE_DIR/src/data:/data" \
|
||||
-v "$SERVICE_DIR/scripts:/scripts" \
|
||||
-w /home \
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
-e FALKORDB_HOST="${FALKORDB_HOST:-host.docker.internal}" \
|
||||
-e FALKORDB_PORT="${FALKORDB_PORT:-6379}" \
|
||||
-e FALKORDB_PASSWORD="${FALKORDB_PASSWORD:-}" \
|
||||
-e FALKORDB_GRAPH="${FALKORDB_GRAPH:-inse}" \
|
||||
-e PRINT_ES_QUERIES=false -e PRINT_ES_TIMINGS=false \
|
||||
-e HF_HUB_DISABLE_PROGRESS_BARS=1 -e TQDM_DISABLE=1 \
|
||||
--entrypoint sh "$IMAGE" -c \
|
||||
'pip install -q --root-user-action=ignore --disable-pip-version-check -r /scripts/falkordb/requirements.txt && exec python "/scripts/falkordb/$0" "$@"' \
|
||||
"$SCRIPT" "$@"
|
||||
@@ -1,5 +0,0 @@
|
||||
# extracted person-level data + generated artifacts — never commit
|
||||
cache/
|
||||
reports/
|
||||
*.log
|
||||
__pycache__/
|
||||
@@ -1,518 +0,0 @@
|
||||
# Multiplicator detection — offline pipeline
|
||||
|
||||
Detects **multiplicators** among an institution's researchers — *bridgers* (connect
|
||||
disconnected research communities), *mentors* (bring up junior/debutant co-authors), and
|
||||
*amplifiers* (patents, industry co-authorship, news visibility) — from OpenAlex plus the
|
||||
patent/project/news sources, and writes per-author scores + tags + evidence to a derived
|
||||
Elasticsearch index.
|
||||
|
||||
Follows the repo's offline pattern (`scripts/patents/index_org_patents.py`): all analysis
|
||||
and joining happen **offline**, the result lands in a **separate, institution-parameterised
|
||||
ES index**, and a thin read-only backend router is added only once the UI needs it.
|
||||
|
||||
**New here? Read [ROADMAP.md](docs/ROADMAP.md) first** — a ground-up explanation of the
|
||||
concept, every index field, the related work behind the metrics, and what's next.
|
||||
|
||||
## Status
|
||||
|
||||
**M0 — spike: done. M1 — metrics core: done** (exit check PASS). **M2 — pipeline +
|
||||
`multiplicators_v1` index: done** (idempotency verified). **M3 — amplifier signal
|
||||
joins: wired and indexed** (patents / news / CORDIS; results below) — remaining:
|
||||
the coach calibration session. **M4 — read router:** pending, once the UI needs it.
|
||||
All results per milestone are documented in the sections below.
|
||||
|
||||
## Setup
|
||||
|
||||
```bash
|
||||
cd service/scripts/multipliers
|
||||
python -m venv .venv && source .venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
Credentials are read from `service/src/main/inse/.env`:
|
||||
- `ELASTICSEARCH_URL` / `ELASTICSEARCH_API_KEY` — NES cluster (OpenAlex).
|
||||
- `ELASTICSEARCH_INSE_URL` / `ELASTICSEARCH_INSE_API_KEY` — INSE cluster (patents, news).
|
||||
|
||||
## Run the spike
|
||||
|
||||
```bash
|
||||
# Extract + audit for University of Duisburg-Essen (writes cache/ + report json)
|
||||
python spike_audit.py --institution-id I62318514
|
||||
|
||||
# Re-audit from the cache without re-hitting ES
|
||||
python spike_audit.py --institution-id I62318514 --skip-extract
|
||||
|
||||
# Also test write/delete permissions on the INSE cluster (throwaway index)
|
||||
python spike_audit.py --institution-id I62318514 --probe-writes
|
||||
```
|
||||
|
||||
Outputs land in `cache/`:
|
||||
- `authors_<ID>.jsonl.gz` — the two-group author union.
|
||||
- `works_<ID>.jsonl.gz` — full-authorship works (external co-authors + institutions).
|
||||
- `spike_report_<ID>.json` — the audit report.
|
||||
|
||||
The report answers: reproduction (author/work counts), field coverage
|
||||
(`author_position` / `is_corresponding` / institution `type`), scale (authors-per-work
|
||||
histogram, pair counts at caps 20/50/100), career quality (suspicious-profile %,
|
||||
`active_years` distribution), signal reachability (`org_patents` match-type breakdown),
|
||||
and write permissions.
|
||||
|
||||
`cache/` is disposable and should not be committed (it can be hundreds of MB and contains
|
||||
extracted person data).
|
||||
|
||||
---
|
||||
|
||||
## M0 spike results (I62318514, run 2026-07-15)
|
||||
|
||||
The spike existed to answer six questions the whole design was betting on. Full raw
|
||||
numbers in `cache/spike_report_I62318514.json`; this section explains each stat, why it
|
||||
was measured, and which downstream metric it feeds.
|
||||
|
||||
### 1. Reproduction — is the extraction correct?
|
||||
|
||||
| Stat | Value | Meaning |
|
||||
|---|---|---|
|
||||
| Author count | **4,921** | Exactly reproduces the audited seed extraction (`llm_evaluations/basic_applied_experimental/ude_audit_report.json`). Our port of the query is faithful. |
|
||||
| — `backend_compatible` group | 4,740 | Authors with `last_known_institutions == UDE` **and** a recent UDE affiliation. |
|
||||
| — `empty_last_known_recent` group | 181 | Authors with a recent UDE affiliation but **no** `last_known_institutions` at all. Without this second query group, 3.7% of the cohort would silently vanish — this is why the author set is a *union of two queries*, not one. |
|
||||
| Work count | **183,661** | All works by those 4,921 authors, globally, unrestricted by institution or year. Matches the seed audit. |
|
||||
|
||||
**Contributes to:** everything. This is the corpus. The "all works globally" property is
|
||||
load-bearing for the career metrics: it means `active_years` is *exact* for in-set
|
||||
authors (we see their complete history), while for external co-authors we only see works
|
||||
shared with UDE — which is why mentor metrics are restricted to UDE-internal pairs.
|
||||
|
||||
### 2. Field coverage — are the fields the metrics need actually populated?
|
||||
|
||||
The OpenAlex Pydantic models declare these fields, but that says nothing about whether
|
||||
the ES index actually populates them. Two sub-scores would have died silently.
|
||||
|
||||
| Stat | Value | Feeds | Verdict |
|
||||
|---|---|---|---|
|
||||
| Authorships total | 3,805,507 | — | denominator |
|
||||
| `author_position` populated | **100%** | `last_author_with_junior_first` (mentor): the classic supervision signature — PI last, junior first. | ✅ computable |
|
||||
| `is_corresponding` populated | **100%** | reserved for later refinement (corresponding-author weighting). | ✅ available |
|
||||
| `institutions.type` populated | **99.91%** | `cross_sector_share` / `industry_coauthor_share` (bridger + amplifier): share of works with a co-author at `type == "company"`. | ✅ computable |
|
||||
| Company-institution occurrences | **67,131** | same | dense enough to rank on — this is the strongest *ID-linked* industry signal we have, stronger than any name-matched source. |
|
||||
|
||||
**Contributes to:** confirms the metric set needs no fallbacks. Had `institutions.type`
|
||||
been empty, the amplifier would have collapsed onto 123 high-confidence patents (see §6).
|
||||
|
||||
### 3. Scale — where does the pair explosion land, and what cap do we need?
|
||||
|
||||
Co-author pair generation is quadratic per work: a work with *n* authors yields
|
||||
*n·(n−1)/2* pairs. The distribution of authors-per-work decides whether the self-join is
|
||||
feasible locally and where to cap it.
|
||||
|
||||
| Stat | Value |
|
||||
|---|---|
|
||||
| Authors per work p50 / p90 / p99 / max | **5 / 17 / 144 / 4,839** |
|
||||
| Works with > 100 authors | **2,459** (1.3%) |
|
||||
| Pair instances at cap 20 / 50 / 100 | **3.9M / 8.0M / 13.9M** |
|
||||
|
||||
**Why `max_authors_per_work` matters** (the cap): the max-4,839-author work alone would
|
||||
generate ~11.7M pairs — more than the *entire rest of the corpus* at cap 50 — and a
|
||||
hyperauthored consortium paper (CERN/medical mega-trials) carries no real collaboration
|
||||
signal: being 1 of 4,839 names says nothing about who actually works with whom, but it
|
||||
*would* create a giant artificial clique that inflates betweenness and strength for
|
||||
everyone on it, poisoning the bridger score. The cap drops works above the threshold
|
||||
from **graph construction only** — they still count for publication years / `active_years`.
|
||||
|
||||
**Chosen: `max_authors_per_work = 50`.** Rationale: p90 = 17, so a cap of 50 keeps ≥ 99%
|
||||
of works (cap sits well above p90, below p99 = 144) while excluding only true
|
||||
hyperauthorship; the resulting 8.0M pair instances collapse to ~1–2M distinct edges,
|
||||
comfortably in-memory for polars. It's a config value (`extraction.max_authors_per_work`),
|
||||
not code — tunable per institution.
|
||||
|
||||
**Contributes to:** graph construction (Stage C); confirms the "pure local compute, no
|
||||
DuckDB/warehouse" bet.
|
||||
|
||||
### 4. Career quality — can we bucket careers, and how bad is profile merging?
|
||||
|
||||
Background: `analysis/career_stage/` established that `first_publication_year` is
|
||||
unreliable at UDE (merged OpenAlex profiles → debut years of 1893/1906 for active
|
||||
professors) and that `active_years` (distinct years with ≥ 1 publication) is robust.
|
||||
The pipeline therefore buckets by `active_years` and uses prefix-counted
|
||||
`active_years_at(A, Y)` instead of debut years for the mentor metrics.
|
||||
|
||||
| Stat | Value | Meaning / use |
|
||||
|---|---|---|
|
||||
| Suspicious profiles | **225 (4.6%)** | `first_year < 1970 or career_span > 60` (same flag as `persons/logic.py`). These are likely *merged identities*. They are **not dropped** — their `active_years` is still fine — but their evidence is marked `low_confidence`. Especially important for the **bridger** score: a merged profile is one node standing in for two people and *systematically* fakes bridging. |
|
||||
| `active_years` p50 / p90 / max / mean | **4 / 25 / 60 / 8.9** | p50 = 4 means **half the cohort is career-stage "Early" (≤ 4)**. This is why percentile normalization happens *within career buckets* (Early/Emerging/Established/Senior via `_classify_career_stage`): institution-wide percentiles would just rank seniority, and no early-career person could ever surface as a multiplicator. |
|
||||
|
||||
**Contributes to:** career bucketing (scoring), mentor junior/senior thresholds,
|
||||
confidence flags on evidence.
|
||||
|
||||
### 5. Permissions — can we ship the result anywhere?
|
||||
|
||||
Initial spike: `PUT` to create an index on the INSE cluster → **403** (key can read, not
|
||||
create). Resolved 2026-07-15: **`multiplicators_v1` was created by the cluster admin**,
|
||||
and the standard INSE key can now write to it (verified: doc create + delete both
|
||||
succeed). The build step must therefore *never* try to create/re-create the index — only
|
||||
delete-by-institution + bulk-index into the existing one (same constraint as
|
||||
`org_patents`, whose key also rejects `_delete_by_query`; use the search + bulk-delete
|
||||
loop from `patents/org/elastic_search_client.py`).
|
||||
|
||||
**Contributes to:** M2 index/build design.
|
||||
|
||||
### 6. Signal reachability — which amplifier sources are real?
|
||||
|
||||
| Stat | Value | Meaning |
|
||||
|---|---|---|
|
||||
| `org_patents` docs for UDE | **436** | The patent→OpenAlex-author link index exists and is populated. |
|
||||
| — `match_type: name` | 313 | Name-only match. **Evidence only, weight 0** — name matching is the weakest link type. |
|
||||
| — `match_type: both` | 65 | Institution assignee **and** name match — highest confidence. **Scores.** |
|
||||
| — `match_type: institution` | 58 | Institution-assignee match. **Scores.** |
|
||||
|
||||
**Contributes to:** amplifier sub-score. Only 123 patents are high-confidence, so patents
|
||||
are a *secondary* amplifier signal; the primary is `industry_coauthor_share` (67k
|
||||
ID-linked company co-authorships, §2). News (`aktuell_postproc`, exact-string person
|
||||
match) enters at low weight; DFG (token containment) and Bund (no person link) are
|
||||
excluded entirely.
|
||||
|
||||
### Spike exit criteria — all met (see below for M1)
|
||||
|
||||
- ✅ Extraction reproduces the audited counts exactly.
|
||||
- ✅ Every planned metric is confirmed computable — no fallbacks needed.
|
||||
- ✅ `max_authors_per_work = 50` chosen from measured data.
|
||||
- ✅ Write path to `multiplicators_v1` verified end-to-end.
|
||||
- ✅ Amplifier signal priorities re-ordered based on measured density
|
||||
(industry co-authorship primary, patents secondary).
|
||||
|
||||
---
|
||||
|
||||
## M1 results (metrics core, run 2026-07-15)
|
||||
|
||||
Modules: `graph.py` (co-author graph via polars self-join, decay weights, hyperauthorship
|
||||
cap), `metrics.py` (Brandes betweenness with inverted weights, Burt constraint on the
|
||||
full graph incl. externals, field entropy, industry co-author share, debut-year-free
|
||||
mentor metrics on `active_years_at`), `scoring.py` + `multipliers.yaml`
|
||||
(within-career-bucket percentiles → weighted sub-scores → tags). 26 unit tests
|
||||
(`pytest`), including exact agreement with networkx oracles for betweenness/constraint
|
||||
and the planted-1893-outlier regression guard for `active_years_at`.
|
||||
|
||||
Run with:
|
||||
|
||||
```bash
|
||||
python build.py --institution-id I62318514 # scores + summary from the cache
|
||||
python validate_sample.py --institution-id I62318514 # 60-person exit check
|
||||
```
|
||||
|
||||
### Full-corpus run (I62318514)
|
||||
|
||||
| Stat | Value |
|
||||
|---|---|
|
||||
| Runtime end-to-end | **2.6 min** (load 15s, graph 31s, metrics 112s) — exit criterion was < 15 min |
|
||||
| Graph | 639,544 nodes (4,921 focal + externals), 4,143,499 edges |
|
||||
| Works used / capped | 160,396 / 4,823 (`max_authors_per_work = 50`) |
|
||||
| Tags at threshold 0.85 | bridger 66, mentor 91, amplifier 609 |
|
||||
|
||||
The amplifier tag count is inflated for now: only `industry_coauthor_share` exists at M1
|
||||
(patents/news/CORDIS join in M3), so weight redistribution makes it a single-metric
|
||||
sub-score. Ignore amplifier tags until M3.
|
||||
|
||||
### M1 exit check — PASS
|
||||
|
||||
Against the 60 hand-labeled researchers in `analysis/career_stage/career_stage_sample.csv`
|
||||
(31 Professor / 29 Researcher), mentor scores must concentrate on professors:
|
||||
|
||||
| known status | n | median mentor score |
|
||||
|---|---|---|
|
||||
| Professor | 25 | **0.715** |
|
||||
| Researcher | 18 | 0.493 |
|
||||
|
||||
Top of the list is face-valid: senior professors with 30–50 mentored juniors and strong
|
||||
last-author-with-junior-first signatures (Bacher, Sures, Hering, Gunzer, …). The two
|
||||
high-scoring "Researchers" are informative, not embarrassing: e.g. a core-facility
|
||||
scientist with 37 juniors but **zero** last-author works — the independent supervision
|
||||
signature correctly separates "publishes with many juniors" from "supervises them".
|
||||
|
||||
### ⚠ Cohort-coverage finding (must be decided in M2)
|
||||
|
||||
17 of the 60 sample people are missing from the 4,921-author cohort. Diagnosed causes:
|
||||
|
||||
1. **University-hospital clinicians are systematically excluded.** Prominent UDE
|
||||
medicine professors (e.g. Witzke, Bingel) have
|
||||
`last_known_institutions = Essen University Hospital (I4210119759)`, and the
|
||||
hospital is **not** in UDE's OpenAlex lineage — OpenAlex models it as a *related*
|
||||
institution, not a child. **2,437 active (2025+) authors** sit behind this gap —
|
||||
roughly half a cohort. Fix: make the cohort definition accept a list of
|
||||
institution IDs (`I62318514` + `I4210119759` + …) per deployment, sourced from
|
||||
`associated_institutions` and confirmed by a human.
|
||||
2. **Stale affiliation years exclude current staff.** E.g. Saccà has
|
||||
`last_known = UDE` but no `affiliations.years >= 2025` entry, so the recency
|
||||
filter drops her. Fix candidates: widen the window (>= 2023), or accept
|
||||
`last_known = UDE` alone with a works-recency check.
|
||||
|
||||
Both are extraction-time cohort decisions with precision/recall tradeoffs — they belong
|
||||
to the coaches/product owner, not to code defaults.
|
||||
|
||||
---
|
||||
|
||||
## M1 validation in detail (what was checked, against what ground truth)
|
||||
|
||||
### The ground truth
|
||||
|
||||
`analysis/career_stage/career_stage_sample.csv` — 60 UDE researchers with manually
|
||||
researched **role labels** (`known_status`: 31 Professor / 29 Researcher incl. doctoral),
|
||||
across five discipline groups (Biology, CS, Engineering, Medicine, Sociology), each with
|
||||
an OpenAlex author ID (so the join to our scores is exact — no name matching involved).
|
||||
The sample was originally built for the career-stage analysis; it does **not** label
|
||||
anyone as a "multiplicator" — no such ground truth exists yet (that is the M3 golden set
|
||||
the innovation coaches will provide).
|
||||
|
||||
### What exactly was evaluated
|
||||
|
||||
One directional sanity check on the riskiest sub-score: *supervision is part of the
|
||||
professor role, so if the mentor sub-score measures anything like real mentorship,
|
||||
professors must score systematically higher than researchers.* Defined check:
|
||||
professors' **median mentor sub-score > researchers'**.
|
||||
|
||||
The check is stronger than it looks because scores are percentiles **within career
|
||||
buckets**: a Senior researcher is compared against Senior professors, not against PhD
|
||||
students, so a trivial "older people score higher" effect is largely normalized away —
|
||||
the gap has to come from mentor behaviour (juniors mentored, last-author-with-junior-
|
||||
first works), not raw seniority.
|
||||
|
||||
### Results (UDE-only cohort, 2026-07-15; archived as `cache/*_I62318514.udeonly.json`)
|
||||
|
||||
43 of 60 matched (17 missing — see the cohort-coverage finding above). Medians:
|
||||
|
||||
| sub-score | Professor (n=25) | Researcher (n=18) | check |
|
||||
|---|---|---|---|
|
||||
| **mentor** | **0.715** | **0.493** | **PASS** |
|
||||
| bridger | 0.603 | 0.508 | (informational) |
|
||||
| amplifier | 0.655 | 0.413 | (single-metric until M3 — ignore) |
|
||||
|
||||
Ranking detail, more convincing than the medians:
|
||||
|
||||
- Top = senior professors with strong dual signals: Gerd Bacher (37 juniors, 16
|
||||
last-author-junior-first works), Bernd Sures (52, 24), Daniel Hering (35, 25),
|
||||
Matthias Gunzer (54 juniors).
|
||||
- Bottom = early-career researchers with 0 juniors.
|
||||
- The two high-scoring "Researchers" are the system working, not failing:
|
||||
Birte Möhlendick (0.924, 12 juniors) — plausibly a group leader whose formal title
|
||||
lags her role; Farnusch Kaschani (0.714, **37 juniors but 0 last-author works**) —
|
||||
the classic core-facility-scientist profile: on many students' papers without
|
||||
supervising them. The two mentor signals disagreeing on exactly this person is why
|
||||
`last_author_with_junior_first` exists as an independent cross-check.
|
||||
|
||||
### What this does NOT show
|
||||
|
||||
It validates the *direction* of the mentor proxy, not that top-ranked people are good
|
||||
mentors or multiplicators: professor-vs-researcher is a coarse label, n=43 is small,
|
||||
bridger has no ground truth in this sample, and amplifier is a single-metric score until
|
||||
M3. The real validation is the coach golden set (M3). This check is kept as a
|
||||
regression: re-run `validate_sample.py` after every weight change or dump refresh.
|
||||
|
||||
---
|
||||
|
||||
## Cohort fix + re-run (2026-07-15, config version 2)
|
||||
|
||||
The hospital gap above is fixed by a **configurable cohort list**: `cohorts.<primary-ID>.
|
||||
institution_ids` in `multipliers.yaml`. **How the list was discovered — and how to
|
||||
build one for another university — is documented in
|
||||
[ASSOCIATED_INSTITUTIONS.md](docs/ASSOCIATED_INSTITUTIONS.md).** For UDE it holds 9 institutions — UDE, Essen
|
||||
University Hospital, the West German Heart Center, the Erwin L. Hahn Institute, and the
|
||||
five OpenAlex lineage children (RISP, DTNW, KWI, ZBT, IUTA) — with the deliberate
|
||||
exclusions (Kliniken Essen-Mitte, the independent An-Institute) documented inline for
|
||||
the coaches to revisit. Candidates were sourced from `associated_institutions` in
|
||||
`openalex-institutions`; the extractor now matches `last_known_institutions` /
|
||||
`affiliations` by **institution ID terms** over the whole list.
|
||||
|
||||
### Before / after (UDE-only → 9-institution cohort)
|
||||
|
||||
| | UDE-only | cohort | note |
|
||||
|---|---|---|---|
|
||||
| Authors | 4,921 | **6,583** | +1,662, mostly hospital clinicians |
|
||||
| Works | 183,661 | **221,603** | |
|
||||
| Graph | 640k nodes / 4.14M edges | 764k / 5.26M | |
|
||||
| Pipeline runtime | 2.6 min | **4.5 min** | still far under the 15-min criterion |
|
||||
| Sample matched | 43/60 | **45/60** | Witzke + Bingel recovered |
|
||||
| Mentor exit check | 0.715 vs 0.493 PASS | **0.699 vs 0.493 PASS** | stable |
|
||||
| Tags (bridger/mentor/amplifier) | 66/91/609 | 96/131/763 | scales with cohort |
|
||||
|
||||
Face validity of the fix: both recovered professors immediately tag as mentors with
|
||||
strong evidence — Witzke (Senior, 73 juniors mentored), Bingel (Senior, 34 juniors,
|
||||
21 last-author-with-junior-first works).
|
||||
|
||||
### The remaining 15 missing, fully diagnosed
|
||||
|
||||
- **9 × correctly excluded** — they left UDE (`last_known` now Halle, Würzburg,
|
||||
Greifswald, OU Netherlands, ISG, or none). The sample is older than the corpus;
|
||||
these are not gaps.
|
||||
- **6 × stale-affiliation cases** — `last_known` IS in the cohort but their most
|
||||
recent cohort affiliation year is 2021–2024, so the `affiliation_years_gte: 2025`
|
||||
recency filter drops them. At least one (Saccà, last seen 2024) is a current
|
||||
professor — publication lag alone can push someone out of a 1-year window.
|
||||
**Recommendation for M2:** set `extraction.affiliation_years_gte: 2023` (already
|
||||
config) — captures normal publication lag while still excluding long-departed
|
||||
authors. Decide with the coaches; it trades a little precision for recall.
|
||||
|
||||
---
|
||||
|
||||
## M2 — pipeline + ES index (done 2026-07-15)
|
||||
|
||||
New modules: `extract.py` (canonical cohort-aware extraction, config-driven),
|
||||
`index.py` (`MultiplicatorsIndexClient` for `multiplicators_v1` on the INSE cluster),
|
||||
`build.py` (single entry point: extract → graph → metrics → scoring → index).
|
||||
`spike_audit.py` remains self-contained for auditing any institution.
|
||||
|
||||
```bash
|
||||
python build.py --institution-id I62318514 # full run (reuses cache)
|
||||
python build.py --institution-id I62318514 --force-extract # refresh from ES
|
||||
python build.py --institution-id I62318514 --no-index # local artifacts only
|
||||
```
|
||||
|
||||
### Index contract (`multiplicators_v1`, INSE cluster)
|
||||
|
||||
- Doc `_id` = `<institution_short>_<author_short>` (e.g. `I62318514_A5087456839`);
|
||||
one doc per author per institution.
|
||||
- Every doc: raw metrics, per-bucket percentiles, sub-scores, tags, career bucket,
|
||||
`suspicious_profile`, evidence (junior ids), `config_hash`, `computed_at`,
|
||||
`cohort_institution_ids`. Explicit mapping is PUT on every run (additive).
|
||||
- Idempotent re-runs: collect the institution's doc ids → bulk-delete → bulk-index →
|
||||
poll `_count` until the expected count is visible. **Verified: delete 9,474 →
|
||||
index 9,474 → count 9,474.**
|
||||
|
||||
### Key-permission gotchas (learned the hard way, encoded in `index.py`)
|
||||
|
||||
The admin-created index + standard INSE key allows: read, `_bulk` index/delete,
|
||||
`_mapping` updates, `_count`. It does **not** allow: index create/delete,
|
||||
`_delete_by_query` (same as org_patents), and — new finding — **`_refresh`
|
||||
(`indices:admin/refresh` → 403)**. A first client version silently relied on refresh
|
||||
and saw phantom docs during delete (stale visibility inflated the delete count) and a
|
||||
too-early post-index count. The client now never calls `_refresh`: it collects all doc
|
||||
ids BEFORE deleting, and verifies by polling `_count` (auto-refresh ≈ 1s) instead.
|
||||
|
||||
### Run with `affiliation_years_gte: 2023` (config v2 → v3)
|
||||
|
||||
| | 2025 cutoff | 2023 cutoff |
|
||||
|---|---|---|
|
||||
| Authors / works | 6,583 / 221,603 | **9,475 / 267,467** |
|
||||
| Graph | 764k nodes / 5.26M edges | 865k / 5.82M |
|
||||
| Full runtime (incl. extract + index) | — | **~14.5 min** |
|
||||
| Sample matched | 45/60 | **51/60** |
|
||||
| Mentor exit check | 0.699 vs 0.493 PASS | **0.740 vs 0.494 PASS** (wider gap) |
|
||||
|
||||
The 9 still-missing sample people are exactly the 9 confirmed leavers (last_known now
|
||||
Halle, Würzburg, Greifswald, …) — correct exclusions, zero unexplained gaps. All six
|
||||
stale-affiliation cases were recovered (some via 2023+ affiliations with the hospital /
|
||||
institute cohort members rather than UDE itself).
|
||||
|
||||
Career-bucket distribution in the index: Early 5,361 / Emerging 1,591 /
|
||||
Established 777 / Senior 1,745. Tags: bridger 133, mentor 161, amplifier 1,107
|
||||
(amplifier still single-metric until M3 — ignore).
|
||||
|
||||
### Next (M3)
|
||||
|
||||
Wire the signal joins into the amplifier score (`org_patents` match_type
|
||||
institution/both, news with name normalization at low weight, CORDIS DOI-join),
|
||||
then calibrate the YAML weights with the innovation coaches against their golden set.
|
||||
M4 (read router in `inse/`) once the UI needs it.
|
||||
|
||||
---
|
||||
|
||||
## M3 — amplifier signal joins (done 2026-07-15)
|
||||
|
||||
Before wiring, a live-index audit showed the amplifier was degenerate: its only input
|
||||
(`industry_coauthor_share`) was 0 for 61.5% of the cohort, and the "top amplifiers"
|
||||
were small-denominator ratio artifacts (share = 1.0 with 2 typed works). Two fixes:
|
||||
|
||||
1. **Shrinkage**: scoring now uses `industry_coauthor_share_shrunk = company/(typed+k)`
|
||||
(k=5, config `signals.industry_share_shrinkage_k`); the raw share stays in the doc.
|
||||
2. **Three independent signal joins** (`signals.py`), weights in YAML
|
||||
(shrunk share 0.50 / patents 0.25 / CORDIS 0.15 / news 0.10):
|
||||
|
||||
| signal | join mechanism | UDE yield (9,474 authors) |
|
||||
|---|---|---|
|
||||
| `patent_count` | `org_patents.matched_authors` author IDs, `match_type ∈ {institution, both}`; name-only kept as `patent_count_name_only` evidence, never scored | 55 authors (17 more name-only) |
|
||||
| `news_mentions` | `aktuell_postproc` LLM-extracted names, normalized-exact match (casefold + diacritic fold); a normalized name shared by >1 cohort authors credits NO ONE | 1,369 authors; **839 ambiguous names skipped** (precision over recall) |
|
||||
| `cordis_eu_projects` | DOI overlap with `cordis_eu_*_publications` → distinct projectIDs. **Case-insensitive term matching** — 21% of CORDIS DOIs contain uppercase and a plain `terms` query silently misses them | 1,342 authors |
|
||||
|
||||
Signal join runtime ≈ 9 min (the case-insensitive CORDIS batches dominate); total
|
||||
pipeline ≈ 20 min. Mentor/bridger untouched: validation unchanged (51/60, mentor
|
||||
check PASS 0.740 vs 0.494).
|
||||
|
||||
### Effect on the amplifier tag
|
||||
|
||||
Tags went **1,107 → 10**. With four independent inputs, a ≥0.85 *weighted mean* of
|
||||
within-bucket percentiles requires being near the top on most channels — the tag now
|
||||
means something. The new top-10 is face-valid (Wiltfang, Erbel, Kaiser, Schierning —
|
||||
patent-holding, industry-connected, media-visible seniors). Two open calibration
|
||||
questions for the coaches:
|
||||
|
||||
- **Threshold per tag?** 0.85 yields 133 bridgers / 161 mentors / 10 amplifiers.
|
||||
If more amplifier candidates are wanted, either lower a per-tag threshold
|
||||
(currently one global `tags.threshold`) or re-weight.
|
||||
- **Split-profile artifact**: an Early-bucket author with 1 active year made top-10
|
||||
amplifier — almost certainly a split OpenAlex profile of a senior professor
|
||||
(patents/news land on the fragment). Bucket-relative ranking amplifies fragments;
|
||||
the `suspicious_profile` flag does not catch splits (only merges). Known
|
||||
limitation — ORCID-based resolution is the deferred fix.
|
||||
|
||||
### M3 remaining
|
||||
|
||||
The **coach calibration session**: golden set of 10–20 known multiplicators, tune the
|
||||
YAML (weights, per-tag thresholds), re-run `validate_sample.py` as regression.
|
||||
|
||||
---
|
||||
|
||||
## Network visualization index (`multiplicator_networks_v1`, added 2026-07-16)
|
||||
|
||||
The scores index answers *what did this person score*; this companion index answers
|
||||
*who are they connected to and how* — everything a frontend needs to draw the
|
||||
ego-network figures (force layout, role colors, tooltips) without recomputing
|
||||
anything. Materialized by `build.py` (`networks.py`) while the full graph is in
|
||||
memory, because the **neighbor-neighbor edges** that make graph shape readable
|
||||
(dense mesh = one community; spokes with gaps = brokered structural holes) come from
|
||||
works that do NOT include the ego — no request-time query can reconstruct them.
|
||||
|
||||
One doc per focal author, `_id = <institution>_<author>` (same scheme as scores):
|
||||
|
||||
| field | content |
|
||||
|---|---|
|
||||
| `nodes[]` | `{id, name, role, inst, active_years, suspicious, company_insts?}`; role ∈ ego / mentee / cohort / industry / external. **`industry` is tie-level**: assigned only when a company affiliation of the neighbour appears on a work *shared with the ego* (matching what `industry_coauthor_share` counts), and `company_insts` names the triggering companies — a lifetime-flag version painted predominantly-academic people orange over a single old dual affiliation. `inst` is the author's most frequent institution. |
|
||||
| `edges[]` | `{a, b, w, n_works, cross, first_year, last_year}` — `w` = decayed tie strength, `cross` = mostly cross-institution |
|
||||
| `ego{}` | header duplicate (bucket, tags, sub_scores, max_sub_score) so a network endpoint renders standalone |
|
||||
| totals | `total_coauthors`, `cohort_coauthors`, `mentee_count`, `shown`, `shown_mentees` |
|
||||
| provenance | `config_hash`, `computed_at`, `cohort_institution_ids` |
|
||||
|
||||
Selection: strongest `network.max_nodes` (42) co-authors by tie weight with up to
|
||||
`network.max_forced_mentees` (14) mentees force-included first — mentees' ties are
|
||||
decayed and team-size-divided, so a pure top-by-weight cut hides exactly the people
|
||||
the mentor score is about. Positions are NOT stored: the webapp's echarts `graph`
|
||||
series (force layout) lays out at render time; map role → color, active_years →
|
||||
symbol size, `cross` → dashed line.
|
||||
|
||||
`nodes`/`edges` are mapped `"enabled": false` (stored, never indexed) — the index
|
||||
stays small and fast for the queryable header fields (`institution_id`, `author_id`,
|
||||
`ego.tags`, `computed_at`, …). Skip building with `--no-network`.
|
||||
|
||||
### Regenerating the HTML report
|
||||
|
||||
`make_report.py` renders a self-contained HTML report of four contrasting cases
|
||||
straight from the two live ES indices — no local cache required, so it works on any
|
||||
machine with cluster access after a build has run:
|
||||
|
||||
```bash
|
||||
python make_report.py --institution-id I62318514
|
||||
# -> reports/multiplier_networks.html (open in any browser; light/dark toggle)
|
||||
|
||||
python make_report.py --institution-id I62318514 \
|
||||
--author-ids A5113304257,A5043495754,A5007801159,A5123934012 # explicit cast
|
||||
```
|
||||
|
||||
The cast is pinned in `report.featured_author_ids` (config) so the report is
|
||||
reproducible across weight tunes and dump refreshes; `--author-ids` overrides it and
|
||||
`--auto` falls back to selecting the current top bridger / mentor / amplifier plus the
|
||||
highest-scoring person who carries **no** tag — the last one exposes where the
|
||||
thresholds bite (and, when that person's best sub-score is *above* 0.85, the
|
||||
`tags.min_active_years` guard that withholds tags from one-year profiles, which are
|
||||
usually **split** OpenAlex identities — the case `suspicious_profile` cannot catch,
|
||||
since that flag detects merges).
|
||||
|
||||
The page layout lives in `report_template.html` (tracked); `reports/` and `cache/` are
|
||||
gitignored, so a `git clean -fdx` or fresh checkout wipes generated reports and
|
||||
extracts — re-run the command above to rebuild the report, and `build.py` only if the
|
||||
indices themselves need refreshing.
|
||||
@@ -1,277 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
build.py — single entry point for the multiplicator pipeline (M2).
|
||||
|
||||
extract (cached) -> graph -> metrics -> scoring -> local artifacts -> ES index.
|
||||
|
||||
python build.py --institution-id I62318514 # full run
|
||||
python build.py --institution-id I62318514 --force-extract # refresh the ES extract
|
||||
python build.py --institution-id I62318514 --no-index # skip the ES write
|
||||
|
||||
Artifacts in --cache-dir:
|
||||
authors_<ID>.jsonl.gz / works_<ID>.jsonl.gz the extract (reused unless --force-extract)
|
||||
scores_<ID>.jsonl.gz one scored row per focal author
|
||||
build_summary_<ID>.json stage timings + tag counts + top lists
|
||||
|
||||
The ES write targets `multiplicators_v1` on the INSE cluster (admin-created; the API
|
||||
key cannot create indices). Doc _id = <institution>_<author>; every run deletes the
|
||||
institution's docs first, so re-runs are idempotent.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import gzip
|
||||
import json
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
from extract import extract_to_cache, read_jsonl_gz
|
||||
from graph import build_graph, short_id
|
||||
from index import NETWORK_MAPPING, NETWORKS_INDEX, MultiplicatorsIndexClient
|
||||
from metrics import compute_all_metrics, incident_edges
|
||||
from networks import build_network_docs
|
||||
from scoring import load_config, score_rows
|
||||
from signals import collect_signals, normalize_doi
|
||||
|
||||
SCRIPT_DIR = Path(__file__).resolve().parent
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--institution-id", required=True)
|
||||
parser.add_argument("--config", default=str(SCRIPT_DIR / "multipliers.yaml"))
|
||||
parser.add_argument("--cache-dir", default=str(SCRIPT_DIR / "cache"))
|
||||
parser.add_argument(
|
||||
"--force-extract", action="store_true",
|
||||
help="Re-extract from ES even if a cache exists.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--no-index", action="store_true",
|
||||
help="Compute and write local artifacts but skip the ES indexing step.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--no-signals", action="store_true",
|
||||
help="Skip the patents/news/CORDIS signal joins (amplifier falls back to "
|
||||
"industry co-authorship alone).",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--no-network", action="store_true",
|
||||
help="Skip materializing the per-author ego-network visualization docs.",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
short = args.institution_id.strip().rsplit("/", 1)[-1]
|
||||
cache_dir = Path(args.cache_dir)
|
||||
config = load_config(args.config)
|
||||
timings: dict[str, float] = {}
|
||||
|
||||
# ---- extract (cache-aware) ----
|
||||
t0 = time.time()
|
||||
authors_path, works_path, insts = extract_to_cache(
|
||||
args.institution_id, config, cache_dir, force=args.force_extract
|
||||
)
|
||||
cohort_short_ids = [i["short_id"] for i in insts]
|
||||
timings["extract_s"] = round(time.time() - t0, 1)
|
||||
|
||||
# ---- load ----
|
||||
t0 = time.time()
|
||||
focal_ids = {a["id"] for a in read_jsonl_gz(authors_path)}
|
||||
works = list(read_jsonl_gz(works_path))
|
||||
timings["load_cache_s"] = round(time.time() - t0, 1)
|
||||
print(f"Loaded {len(works)} works, {len(focal_ids)} focal authors "
|
||||
f"({timings['load_cache_s']}s)")
|
||||
|
||||
# ---- single pass over works before they are freed: DOIs per focal author
|
||||
# (CORDIS join), per-author institution counts (modal label), and per-WORK
|
||||
# company affiliations (tie-level industry roles in the network docs)
|
||||
focal_short_ids = {short_id(a) for a in focal_ids}
|
||||
max_authors = int(config["extraction"]["max_authors_per_work"])
|
||||
dois_by_author: dict[str, set[str]] = {}
|
||||
inst_counts: dict[str, dict[str, int]] = {}
|
||||
company_by_author_work: dict[str, dict[str, list[str]]] = {}
|
||||
company_work_authors: dict[str, set[str]] = {}
|
||||
for w in works:
|
||||
doi = normalize_doi(w.get("doi"))
|
||||
wid = short_id(w.get("id"))
|
||||
work_authors: set[str] = set()
|
||||
work_companies: dict[str, list[str]] = {}
|
||||
for a in w.get("authorships") or []:
|
||||
aid = short_id((a.get("author") or {}).get("id"))
|
||||
if not aid:
|
||||
continue
|
||||
work_authors.add(aid)
|
||||
if doi and aid in focal_short_ids:
|
||||
dois_by_author.setdefault(aid, set()).add(doi)
|
||||
for inst in a.get("institutions") or []:
|
||||
name = inst.get("display_name")
|
||||
if name:
|
||||
counts = inst_counts.setdefault(aid, {})
|
||||
counts[name] = counts.get(name, 0) + 1
|
||||
if inst.get("type") == "company":
|
||||
work_companies.setdefault(aid, []).append(name)
|
||||
# company evidence only for works that also enter the graph (same cap)
|
||||
if wid and work_companies and 2 <= len(work_authors) <= max_authors:
|
||||
company_work_authors[wid] = work_authors
|
||||
for aid, names in work_companies.items():
|
||||
company_by_author_work.setdefault(aid, {})[wid] = names
|
||||
inst_by_author = {
|
||||
aid: max(counts, key=counts.get) for aid, counts in inst_counts.items()
|
||||
}
|
||||
del inst_counts
|
||||
|
||||
# ---- graph ----
|
||||
t0 = time.time()
|
||||
graph = build_graph(
|
||||
works,
|
||||
focal_ids,
|
||||
max_authors_per_work=config["extraction"]["max_authors_per_work"],
|
||||
decay=config["graph"]["decay"],
|
||||
)
|
||||
del works
|
||||
timings["build_graph_s"] = round(time.time() - t0, 1)
|
||||
print(f"Graph: {len(graph.nodes)} nodes, {len(graph.edges)} edges, "
|
||||
f"{graph.n_works_used} works used, {graph.n_works_capped} capped, "
|
||||
f"ref_year={graph.ref_year} ({timings['build_graph_s']}s)")
|
||||
|
||||
# ---- metrics ----
|
||||
t0 = time.time()
|
||||
metric_rows = compute_all_metrics(
|
||||
graph,
|
||||
junior_active_years_max=config["mentor"]["junior_active_years_max"],
|
||||
senior_active_years_min=config["mentor"]["senior_active_years_min"],
|
||||
progressed_active_years_min=config["mentor"]["progressed_active_years_min"],
|
||||
industry_share_shrinkage_k=config.get("signals", {}).get(
|
||||
"industry_share_shrinkage_k", 5
|
||||
),
|
||||
)
|
||||
timings["metrics_s"] = round(time.time() - t0, 1)
|
||||
print(f"Metrics for {len(metric_rows)} focal authors ({timings['metrics_s']}s)")
|
||||
|
||||
# ---- signal joins (patents / news / CORDIS) ----
|
||||
if args.no_signals:
|
||||
print("Skipping signal joins (--no-signals).")
|
||||
timings["signals_s"] = 0.0
|
||||
else:
|
||||
t0 = time.time()
|
||||
signals_cfg = config.get("signals") or {}
|
||||
display_names = {
|
||||
aid: row.get("display_name") or "" for aid, row in metric_rows.items()
|
||||
}
|
||||
signal_counts = collect_signals(
|
||||
short,
|
||||
display_names,
|
||||
{a: d for a, d in dois_by_author.items() if a in metric_rows},
|
||||
scored_match_types=tuple(
|
||||
signals_cfg.get("patent_match_types", ["institution", "both"])
|
||||
),
|
||||
news_require_relevant=signals_cfg.get("news_require_relevant", True),
|
||||
)
|
||||
for metric, counts in signal_counts.items():
|
||||
for aid, row in metric_rows.items():
|
||||
row[metric] = counts.get(aid, 0)
|
||||
timings["signals_s"] = round(time.time() - t0, 1)
|
||||
print(f"Signal joins done ({timings['signals_s']}s)")
|
||||
|
||||
# ---- scoring ----
|
||||
t0 = time.time()
|
||||
scored = score_rows(metric_rows, config)
|
||||
timings["scoring_s"] = round(time.time() - t0, 1)
|
||||
|
||||
scores_path = cache_dir / f"scores_{short}.jsonl.gz"
|
||||
with gzip.open(scores_path, "wt", encoding="utf-8", newline="\n") as f:
|
||||
for row in scored:
|
||||
f.write(json.dumps(row, ensure_ascii=True) + "\n")
|
||||
print(f"Scores -> {scores_path} ({timings['scoring_s']}s)")
|
||||
|
||||
# ---- index into ES ----
|
||||
docs_written = 0
|
||||
if args.no_index:
|
||||
print("Skipping ES indexing (--no-index).")
|
||||
else:
|
||||
t0 = time.time()
|
||||
es = MultiplicatorsIndexClient()
|
||||
es.ensure_mapping()
|
||||
docs_written = es.index_rows(short, cohort_short_ids, scored)
|
||||
count = es.count_for_institution(short)
|
||||
timings["index_s"] = round(time.time() - t0, 1)
|
||||
print(f"Indexed {docs_written} docs into {es.index} "
|
||||
f"(count for {short}: {count}) ({timings['index_s']}s)")
|
||||
if count != len(scored):
|
||||
raise RuntimeError(
|
||||
f"Post-index count mismatch: expected {len(scored)}, index has {count}"
|
||||
)
|
||||
|
||||
# ---- ego-network visualization docs ----
|
||||
network_docs_written = 0
|
||||
if args.no_index or args.no_network:
|
||||
print("Skipping network materialization.")
|
||||
else:
|
||||
t0 = time.time()
|
||||
network_cfg = config.get("network") or {}
|
||||
network_docs = build_network_docs(
|
||||
graph,
|
||||
metric_rows,
|
||||
scored,
|
||||
incident_edges(graph),
|
||||
inst_by_author,
|
||||
company_by_author_work,
|
||||
company_work_authors,
|
||||
max_nodes=int(network_cfg.get("max_nodes", 42)),
|
||||
max_forced_mentees=int(network_cfg.get("max_forced_mentees", 14)),
|
||||
)
|
||||
net_es = MultiplicatorsIndexClient(index=NETWORKS_INDEX)
|
||||
net_es.ensure_mapping(NETWORK_MAPPING)
|
||||
network_docs_written = net_es.index_rows(short, cohort_short_ids, network_docs)
|
||||
timings["network_s"] = round(time.time() - t0, 1)
|
||||
print(f"Indexed {network_docs_written} network docs into {net_es.index} "
|
||||
f"({timings['network_s']}s)")
|
||||
|
||||
# ---- summary ----
|
||||
tag_counts: dict[str, int] = {}
|
||||
for row in scored:
|
||||
for tag in row["tags"]:
|
||||
tag_counts[tag] = tag_counts.get(tag, 0) + 1
|
||||
|
||||
def top(sub: str, k: int = 10):
|
||||
rows = sorted(scored, key=lambda r: r["sub_scores"].get(sub, 0), reverse=True)
|
||||
return [
|
||||
{
|
||||
"author_id": r["author_id"],
|
||||
"name": r["display_name"],
|
||||
"score": r["sub_scores"][sub],
|
||||
"bucket": r["career_bucket"],
|
||||
"active_years": r["active_years"],
|
||||
"suspicious": r["suspicious_profile"],
|
||||
}
|
||||
for r in rows[:k]
|
||||
]
|
||||
|
||||
summary = {
|
||||
"institution": short,
|
||||
"cohort": cohort_short_ids,
|
||||
"config_hash": config["_config_hash"],
|
||||
"counts": {
|
||||
"focal_authors_scored": len(scored),
|
||||
"nodes": len(graph.nodes),
|
||||
"edges": len(graph.edges),
|
||||
"works_used": graph.n_works_used,
|
||||
"works_capped": graph.n_works_capped,
|
||||
"tags": tag_counts,
|
||||
"suspicious_profiles": sum(1 for r in scored if r["suspicious_profile"]),
|
||||
"es_docs_written": docs_written,
|
||||
"es_network_docs_written": network_docs_written,
|
||||
},
|
||||
"timings": timings,
|
||||
"top_bridgers": top("bridger"),
|
||||
"top_mentors": top("mentor"),
|
||||
"top_amplifiers": top("amplifier"),
|
||||
}
|
||||
summary_path = cache_dir / f"build_summary_{short}.json"
|
||||
with open(summary_path, "w", encoding="utf-8", newline="\n") as f:
|
||||
json.dump(summary, f, ensure_ascii=False, indent=2)
|
||||
print(json.dumps(summary["counts"], ensure_ascii=False, indent=2))
|
||||
print(f"Summary -> {summary_path}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,5 +0,0 @@
|
||||
"""Make the module root importable from tests/ (pytest inserts this dir via conftest)."""
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
||||
@@ -1,116 +0,0 @@
|
||||
# Cohort discovery: finding a university's associated institutions in OpenAlex
|
||||
|
||||
How the `cohorts.<ID>.institution_ids` list in `multipliers.yaml` was built for the
|
||||
University of Duisburg-Essen (I62318514), and how to repeat the process for another
|
||||
university. Context: the multiplicator pipeline's author set is only as good as this
|
||||
list — matching UDE alone silently excluded ~2,400 active clinicians, including
|
||||
prominent medicine professors (found via the M1 validation, where 17/60 hand-labeled
|
||||
people were missing).
|
||||
|
||||
## Why this is necessary: `lineage` vs `associated_institutions`
|
||||
|
||||
Every institution document in OpenAlex (index `openalex-institutions`) carries two
|
||||
relationship fields:
|
||||
|
||||
- **`lineage`** — the strict parent hierarchy: a list of institution IDs including the
|
||||
institution itself and its parents. This is what ID-based filters normally use
|
||||
(e.g. `company_connections/logic.py` checks `UDE_OPENALEX_ID in lineage`).
|
||||
- **`associated_institutions`** — a looser list of linked institutions, each with a
|
||||
`relationship` label: `child`, `parent`, or `related`.
|
||||
|
||||
The trap: **OpenAlex models German university hospitals as `related`, not as lineage
|
||||
children.** Essen University Hospital's own `lineage` contains only itself. Any filter
|
||||
built on UDE's ID or lineage therefore can never match hospital-affiliated authors —
|
||||
the entire clinical medical faculty — no matter how the query is written.
|
||||
|
||||
## The discovery method (3 steps)
|
||||
|
||||
### Step 1 — read the university's `associated_institutions`
|
||||
|
||||
Query the `openalex-institutions` document for the primary ID and list its
|
||||
`associated_institutions`. For UDE (I62318514):
|
||||
|
||||
| ID | relationship | name | authors (all-time last_known) |
|
||||
|---|---|---|---|
|
||||
| I4210090139 | child | Rhein-Ruhr Institut für Sozialforschung | 11 |
|
||||
| I4210092428 | child | Deutsches Textilforschungszentrum Nord-West | 170 |
|
||||
| I4210110714 | child | Institute for Advanced Study in the Humanities (KWI) | 81 |
|
||||
| I4210146441 | child | Hydrogen and Fuel Cell Center (ZBT) | 98 |
|
||||
| I4210154243 | child | Institut für Energie- und Umwelttechnik (IUTA) | 233 |
|
||||
| **I4210119759** | **related** | **Essen University Hospital** | **7,484** |
|
||||
| I4210146447 | related | Kliniken Essen-Mitte | 788 |
|
||||
| I2799342142 | related | Salomon Ludwig Steinheim-Institut | — |
|
||||
| I4210124583 | related | IWW Water Centre | — |
|
||||
|
||||
(For comparison: UDE itself has 14,388 all-time last_known authors.)
|
||||
|
||||
### Step 2 — follow one hop into any `related` hospital
|
||||
|
||||
The hospital's own `associated_institutions` revealed a member invisible from UDE's
|
||||
record: the **West German Heart and Vascular Center Essen (I4210161917)** is a `child`
|
||||
of the hospital (1,021 authors) — two hops from UDE.
|
||||
|
||||
### Step 3 — validate against real people (this catches what no query can)
|
||||
|
||||
The **Erwin L. Hahn Institute for MRI (I127668822)** was NOT found by any metadata
|
||||
walk: in OpenAlex it is completely isolated — `lineage` contains only itself,
|
||||
`associated_institutions` is empty. It surfaced only when diagnosing why a specific
|
||||
hand-labeled professor (Ulrike Bingel) was missing from the cohort: it appeared in her
|
||||
affiliation list. Lesson: after building the list from metadata, always check a set of
|
||||
known current researchers against the extracted cohort — the misses point to
|
||||
institutions the graph walk cannot reach.
|
||||
|
||||
## Inclusion decisions for UDE (documented in `multipliers.yaml`)
|
||||
|
||||
**Included (9):**
|
||||
|
||||
- `I62318514` UDE (primary)
|
||||
- `I4210119759` Essen University Hospital — it *is* the university medical centre;
|
||||
its `related` label is an OpenAlex modelling choice, not an organisational fact
|
||||
- `I4210161917` West German Heart and Vascular Center (child of the hospital)
|
||||
- `I127668822` Erwin L. Hahn Institute (joint UDE institute; isolated in OpenAlex)
|
||||
- The five lineage children: RISP, DTNW, KWI, ZBT, IUTA — small but unambiguous
|
||||
|
||||
**Excluded by default (revisit with the coaches):**
|
||||
|
||||
- `I4210146447` Kliniken Essen-Mitte — an independent hospital group; `related`
|
||||
reflects collaboration, not membership; its staff are not UDE researchers
|
||||
- `I2799342142` Salomon Ludwig Steinheim-Institut and `I4210124583` IWW Water
|
||||
Centre — *An-Institute*: legally independent institutes **at** UDE, not **of** it
|
||||
|
||||
The borderline cases are exactly the German-institutional-law ones (An-Institute,
|
||||
municipal hospital groups). These are human judgment calls, which is why the list
|
||||
lives in config with the reasoning inline, not in code.
|
||||
|
||||
## Effect on the cohort (measured)
|
||||
|
||||
| | UDE ID only | 9-institution cohort |
|
||||
|---|---|---|
|
||||
| Authors (affiliation ≥ 2023) | ~7,100¹ | 9,475 |
|
||||
| Hand-labeled sample matched | 43/60² | 51/60 |
|
||||
| Unexplained misses | 17 | **0** (the 9 remaining all verifiably left UDE) |
|
||||
|
||||
¹ approximate — the single-ID number was measured at the 2025 cutoff (4,921); scaled here for context.
|
||||
² at the 2025 cutoff; the cohort fix and the 2023 affiliation window each contributed.
|
||||
|
||||
Recovered by the fix, as a face-validity check: Oliver Witzke (Senior, 73 juniors
|
||||
mentored → tagged mentor) and Ulrike Bingel (Senior, 34 juniors, 21
|
||||
last-author-with-junior-first works → tagged mentor).
|
||||
|
||||
## Repeating this for another university
|
||||
|
||||
1. Fetch `associated_institutions` from `openalex-institutions` for the primary ID;
|
||||
collect all `child` entries and every `related` entry.
|
||||
2. For any `related` hospital / medical centre, fetch ITS `associated_institutions`
|
||||
and collect its children.
|
||||
3. For each candidate, count authors
|
||||
(`last_known_institutions.id == <candidate>` on `openalex-authors`) — size tells
|
||||
you what an inclusion decision is worth.
|
||||
4. Decide inclusions with a human: university hospitals in; independent hospital
|
||||
groups and An-Institute out unless the institution says otherwise.
|
||||
5. Write the `cohorts.<primary-ID>` block in `multipliers.yaml` with the reasoning
|
||||
as inline comments.
|
||||
6. Run the extraction, then validate against a list of known current researchers
|
||||
(professors from several faculties, especially medicine). Every unexplained miss
|
||||
is either a missing cohort member (like the Hahn Institute) or a stale-affiliation
|
||||
case (tune `extraction.affiliation_years_gte`).
|
||||
@@ -1,239 +0,0 @@
|
||||
# Multiplicator Detection — Concept, Technical Walkthrough & Roadmap
|
||||
|
||||
A ground-up explanation of what this module does, how every field in the
|
||||
`multiplicators_v1` index is computed and what it means, where the ideas come from,
|
||||
and where the project stands. Written for a reader with no prior context.
|
||||
|
||||
Companion docs: [README.md](../README.md) (per-milestone results and stats),
|
||||
[ASSOCIATED_INSTITUTIONS.md](ASSOCIATED_INSTITUTIONS.md) (cohort discovery method).
|
||||
|
||||
---
|
||||
|
||||
## 1. What problem this solves
|
||||
|
||||
The university's innovation coaches want to find **multiplicators**: people whose value
|
||||
isn't only their own research output, but their effect on the system around them — they
|
||||
connect groups that otherwise wouldn't talk, they grow junior researchers into
|
||||
independent scientists, they carry research out of academia into industry and the
|
||||
public. These people are invisible in classic rankings (citations, h-index), which
|
||||
measure individual output, not systemic effect.
|
||||
|
||||
The core bet of the whole project: **these behaviors leave measurable traces in
|
||||
publication metadata.** Who you publish with, when, in what role, and across which
|
||||
institutional boundaries is recorded in OpenAlex for every paper. So instead of asking
|
||||
"who is influential?" we ask three narrower, checkable questions, each an archetype:
|
||||
|
||||
- **Bridger** — do your collaborations span otherwise-disconnected communities,
|
||||
fields, institutions, sectors?
|
||||
- **Mentor** — do junior people repeatedly start their careers publishing with you,
|
||||
in the role configuration typical of supervision?
|
||||
- **Amplifier** — does your work escape academia: patents, industry co-authorship,
|
||||
EU projects, press coverage?
|
||||
|
||||
Everything else is machinery for answering those three questions honestly at the
|
||||
scale of ~9,500 people.
|
||||
|
||||
## 2. The pipeline, step by step
|
||||
|
||||
**Step 1 — Define who "the university" is (cohort).** OpenAlex models Essen University
|
||||
Hospital as merely *related* to UDE, not part of it, so filtering by UDE's ID alone
|
||||
silently loses the entire clinical faculty (~2,400 active people). The cohort is
|
||||
therefore an explicit list of 9 institution IDs (UDE + hospital + heart center +
|
||||
affiliated institutes) — the `cohort_institution_ids` array on every document. An
|
||||
author belongs if their last-known institution is in that list **and** they have an
|
||||
affiliation year ≥ 2023 (publication lag makes a 1-year window drop current staff).
|
||||
Details: [ASSOCIATED_INSTITUTIONS.md](ASSOCIATED_INSTITUTIONS.md).
|
||||
|
||||
**Step 2 — Extract.** For those ~9,475 authors we pull **all their works globally** —
|
||||
not just university-affiliated ones — with the *complete* author list of every paper,
|
||||
including external co-authors and each co-author's institution (with its type:
|
||||
education, company, healthcare…). Result: ~267k works, ~3.8M authorship records.
|
||||
The "all works globally" property matters: it makes career histories *exact* for
|
||||
cohort members, while external co-authors' histories are truncated to shared works —
|
||||
a fact the mentor metrics must respect (see §3).
|
||||
|
||||
**Step 3 — Build the co-authorship graph.** Every paper connects each pair of its
|
||||
authors with an edge. Three refinements:
|
||||
|
||||
- **Team-size weighting**: a pair on a 3-author paper gets weight 1/(n−1) = 0.5; on a
|
||||
40-author paper, 1/39. Being 2 of 3 authors is strong evidence you actually work
|
||||
together; being 2 of 40 is weak evidence.
|
||||
- **Time decay**: each paper's contribution is multiplied by 0.8^(years ago). A 2025
|
||||
collaboration counts full; a 2010 one counts ~3%. We're looking for *current*
|
||||
multiplicators.
|
||||
- **Hyperauthorship cap**: papers with >50 authors (CERN-style consortia; the corpus
|
||||
max is 4,839 authors on one paper) are excluded from the graph entirely — that one
|
||||
paper alone would create ~11.7M fake "collaboration" edges and a giant artificial
|
||||
clique. Those papers still count for career metrics.
|
||||
|
||||
Result: ~865k nodes (cohort + all their external co-authors), ~5.8M weighted edges.
|
||||
|
||||
**Step 4 — Compute metrics on that graph** (§3, field by field).
|
||||
|
||||
**Step 5 — Normalize fairly and score.** Raw metrics aren't comparable between a PhD
|
||||
student and a 30-year professor, so every metric becomes a **percentile within the
|
||||
person's career stage**, then three weighted sub-scores, then tags above a threshold
|
||||
(§4).
|
||||
|
||||
**Step 6 — Join external signals** (patents, news, EU projects) and **write everything
|
||||
to `multiplicators_v1`** — one document per person, containing raw values, percentiles,
|
||||
scores, tags, and evidence, so a coach can always see *why* someone scored what they
|
||||
scored.
|
||||
|
||||
## 3. A real document, field by field
|
||||
|
||||
Example: Tabea M. G. Pakull, `_id = I62318514_A5043360678` (institution + author —
|
||||
the same person at another university would be a separate doc). An ES `_version: 8`
|
||||
just means the doc was overwritten 8 times by re-runs; the `fields` block ES returns
|
||||
alongside `_source` is its internal columnar echo — ignore it.
|
||||
|
||||
### Career context
|
||||
|
||||
| field | example value | meaning |
|
||||
|---|---|---|
|
||||
| `active_years` | 3 | Distinct calendar years with ≥1 publication — our seniority measure. We deliberately do **not** use "years since first publication": the repo's career-stage analysis found merged OpenAlex profiles give active professors debut years like 1893. One wrong old paper distorts career span by decades but moves `active_years` by exactly +1. |
|
||||
| `career_bucket` | "Early" | Early ≤4, Emerging ≤9, Established ≤14, Senior >14 active years — thresholds taken unchanged from the backend's `_classify_career_stage`, empirically validated against 60 known professors/researchers. **All percentiles are computed against the same bucket only.** |
|
||||
| `n_works` | 12 | Works in the extract. |
|
||||
| `suspicious_profile` | false | Merged-identity flag (first year <1970 or span >60). True ⇒ treat evidence as low-confidence; ~18% of Seniors carry it. |
|
||||
|
||||
### Bridger metrics (network structure)
|
||||
|
||||
| field | example | what it measures |
|
||||
|---|---|---|
|
||||
| `betweenness` | 0 | **Betweenness centrality** on the cohort-internal graph: how often the strongest connection paths between other cohort members run *through you*. High = the network's traffic must pass you = you connect groups. Edge weights are "closeness", so paths use inverted weights as distances. A 0 is normal early-career; the percentile can still be ~0.44 because most of the bucket is also 0 and ties share their average rank. |
|
||||
| `constraint` → `brokerage` | 0.085 → 0.915 | **Burt's constraint** looks only at your *ego network* (you + your co-authors): do your contacts also know each other? High constraint = you sit inside one dense clique. Low = your contacts live in separate worlds and *you* are the only link — you span "structural holes". Stored as `brokerage = 1 − constraint` so higher = more bridging. Computed on the **full graph including external co-authors**, so it sees outward bridging that internal betweenness can't. In the example: 82 co-authors who barely know each other — 90th percentile of the Early bucket. |
|
||||
| `field_entropy` | 0.98 | Shannon entropy over the scientific fields of the person's papers. 0 = monodisciplinary; 1.0 bit ≈ two fields evenly; 2.0 ≈ four. Topical breadth as a proxy for interdisciplinary bridging (OpenAlex has no faculty structure, so this is the honest substitute — it must never be presented as "bridges faculties"). |
|
||||
| `cross_institution_share` | 0.85 | Share of collaboration weight with co-authors sharing *no* institution with the person — external orientation. |
|
||||
| `strength`, `n_coauthors` | 8.25, 82 | Total decayed edge weight and distinct co-author count — "reach", context only, not scored directly. |
|
||||
|
||||
### Mentor metrics
|
||||
|
||||
OpenAlex has no supervision records and debut years are unreliable, so the mentor
|
||||
signals are built on **`active_years_at(person, year)`** — how many active years
|
||||
someone had accumulated *as of a given year* — which inherits the robustness of
|
||||
`active_years` (a spurious 1893 paper shifts it by exactly 1, not 120).
|
||||
|
||||
| field | definition |
|
||||
|---|---|
|
||||
| `juniors_mentored` | Count of cohort co-authors who, in the year of their *first* joint paper, had ≤4 active years (Early) **while the focal person had ≥10** (Established+). A seniority-*gap* criterion — two PhD students co-publishing never counts. |
|
||||
| `junior_progression_rate` | Of those juniors, the fraction who later reached ≥5 active years — separates "grew them up" from "co-signed once". `null` = no juniors = not applicable (excluded from scoring, not counted against the person). |
|
||||
| `last_author_with_junior_first` | Papers where the person is **last author** with an Early-career **first author** — the classic supervision signature (student first, PI last). Deliberately independent of the gap logic: when the two disagree (37 "juniors" but zero last-author papers) that's the core-facility-scientist pattern, not a mentor. |
|
||||
| `mentoring_rate` | juniors ÷ own active years. Without a rate, prolific seniors win on volume alone (professor median 224 papers vs 11 for researchers). |
|
||||
|
||||
Mentor metrics are computed **only between cohort members**: external co-authors'
|
||||
histories are truncated to shared works, so an external senior would masquerade as a
|
||||
junior. This scope restriction is a data-correctness requirement, not a choice.
|
||||
|
||||
### Amplifier metrics
|
||||
|
||||
| field | source & link quality |
|
||||
|---|---|
|
||||
| `industry_coauthor_share` | Share of typed works with ≥1 company-affiliated co-author. The strongest industry signal available because it's **institution-ID-linked** — no name matching. Kept raw for transparency. |
|
||||
| `industry_coauthor_share_shrunk` | The **scored** variant: company ÷ (typed + 5). Why: with raw shares, someone with 2-of-2 company papers gets share 1.0 and beats someone with 40-of-80 — before this fix, the index's entire top-10 "amplifiers" were such small-denominator artifacts. The +5 makes small samples humble. |
|
||||
| `patent_count` | From `org_patents`, which links patents to OpenAlex author IDs. Only high-confidence matches (`match_type` = institution/both) are scored. |
|
||||
| `patent_count_name_only` | Name-only patent matches — **evidence only, never scored**. |
|
||||
| `news_mentions` | University press corpus, LLM-extracted names, matched after normalizing case and diacritics (René = rene). If a normalized name belongs to *two* cohort people, **nobody** gets credit (839 names skipped at UDE) — miscrediting is worse than missing. Hence the low weight. |
|
||||
| `cordis_eu_projects` | Distinct EU projects joined by **DOI overlap** (the person's paper DOIs ∩ DOIs attached to CORDIS project publications) — no name matching. Matching is case-insensitive because 21% of CORDIS DOIs contain uppercase. |
|
||||
|
||||
### Scoring plumbing
|
||||
|
||||
| field | meaning |
|
||||
|---|---|
|
||||
| `percentiles.*` | Each raw metric's mean-rank percentile *within the career bucket*. Ties share their average rank — that's why a metric at 0 in a mostly-zero bucket shows ~0.44–0.50, not 1.0: a mass of zeros must not be rewarded. `null` metrics are excluded, and their weight is redistributed. |
|
||||
| `sub_scores.{bridger,mentor,amplifier}` | Weighted means of the percentiles. Weights live in `multipliers.yaml`, never in code — coaches retune them. Current amplifier weights: shrunk share 0.50, patents 0.25, CORDIS 0.15, news 0.10. |
|
||||
| `tags` | Sub-score ≥ `tags.threshold` (0.85) ⇒ tag; a person can hold 0–3. Current yield at UDE: 133 bridgers, 161 mentors, 10 amplifiers. |
|
||||
| `max_sub_score` | Best sub-score — the default ranking key. |
|
||||
| `evidence.junior_ids` | Receipts (which people count as mentees) — a coach never sees a bare number. |
|
||||
| `config_hash`, `computed_at` | Which YAML weighting produced the score, and when. Scores are cohort-relative and weight-dependent; without this they'd be unfalsifiable after the next retune. |
|
||||
| `institution_id`, `cohort_institution_ids` | Which university this doc belongs to and which 9 institutions defined its cohort. |
|
||||
|
||||
Worked example (the Pakull doc): amplifier = 0.50·0.99 (shrunk share) + 0.25·0.50
|
||||
(patents, tie-mass) + 0.15·0.98 (one EU project — 98th percentile *for an
|
||||
Early-career person*) + 0.10·0.47 (news) = **0.8131** — high, but under 0.85 ⇒ no
|
||||
tag. Mentor 0.494 ≈ bucket median: all-zero mentor metrics in a bucket where nearly
|
||||
everyone is zero lands exactly mid-pack.
|
||||
|
||||
## 4. related work
|
||||
|
||||
- **Co-authorship graphs as collaboration networks** — Mark Newman's early-2000s
|
||||
studies of scientific collaboration networks, which also introduced the 1/(n−1)
|
||||
team-size weighting. The warning that huge author lists break co-authorship
|
||||
semantics is Blaise Cronin's "hyperauthorship" critique — the basis for the
|
||||
50-author cap.
|
||||
- **Bridger, theory** — Granovetter's "strength of weak ties" (1973): novel
|
||||
information flows across bridges between groups, not within dense cliques.
|
||||
- **Bridger, operationalization** — *betweenness centrality* (Linton Freeman, 1977),
|
||||
computed with Ulrik Brandes' 2001 algorithm (implemented in `metrics.py`, tested
|
||||
against networkx); *structural holes and constraint* (Ronald Burt, 1992; his 2004
|
||||
"Structural holes and good ideas" showed brokers produce more good ideas). The
|
||||
weights-are-distances inversion for betweenness is a standard weighted-network
|
||||
practice. Shannon entropy as a diversity/interdisciplinarity indicator follows
|
||||
standard scientometrics usage (Stirling-style diversity).
|
||||
- **Mentor** — reading mentorship from publication genealogies is established in
|
||||
scientometrics (e.g. Malmgren, Ottino & Amaral's Nature study of mentor–protégé
|
||||
networks). The first-author-student / last-author-PI convention is a documented
|
||||
authorship norm in the life sciences — credible at a medicine-heavy university.
|
||||
Shipped caveat: co-authorship ≠ supervision; it's a proxy, validated directionally
|
||||
against 60 hand-labeled people (professors' median mentor score 0.740 vs
|
||||
researchers' 0.494).
|
||||
- **Amplifier** — the university "third mission" / knowledge-transfer literature
|
||||
(Etzkowitz & Leydesdorff's Triple Helix line): patents, industry co-publication,
|
||||
joint projects as measurable transfer channels. Industry co-authorship as primary
|
||||
indicator is pragmatic: it's the only channel linked by institution IDs rather
|
||||
than names.
|
||||
- **Fair comparison** — percentile indicators within reference groups are the modern
|
||||
bibliometrics standard (compare like with like). Our reference group is the career
|
||||
bucket; the buckets come from this repo's own `analysis/career_stage/` work, which
|
||||
is also the empirical source for the most important design decision: rejecting
|
||||
`first_publication_year` in favor of `active_years`. `active_years_at(A, Y)` is our
|
||||
small extension of that finding.
|
||||
- **Data-quality corrections** (all found by measuring, not assumed): the hospital
|
||||
cohort gap (OpenAlex `related` vs lineage), ratio shrinkage, tie-sharing
|
||||
percentiles, the news ambiguity rule, merged/split-profile flags — responses to
|
||||
the well-known author-disambiguation weaknesses of bibliographic databases.
|
||||
|
||||
## 5. What was achieved (status)
|
||||
|
||||
Three falsifiable behavioral definitions instead of a vague label; a decay- and
|
||||
team-size-weighted collaboration graph over the complete global publication history
|
||||
of a correctly-defined 9-institution cohort; established network-science and
|
||||
bibliometric measures, made robust against the two dominant data pathologies (merged
|
||||
profiles, hyperauthorship); within-career-stage normalization; three independent
|
||||
external evidence channels joined at their honest link quality; and a queryable index
|
||||
where every person carries raw values, percentiles, scores, tags, and receipts —
|
||||
validated against hand-labeled ground truth, every tunable in config, every score
|
||||
stamped with the config that produced it.
|
||||
|
||||
| Milestone | Status |
|
||||
|---|---|
|
||||
| M0 — de-risking spike against the real cluster | ✅ done |
|
||||
| M1 — graph + metrics + scoring core, 60-person validation | ✅ done (PASS) |
|
||||
| M2 — cohort fix, extraction module, idempotent `multiplicators_v1` indexing | ✅ done |
|
||||
| M3 — amplifier signal joins (patents / news / CORDIS) + shrinkage fix | ✅ wired & indexed |
|
||||
|
||||
## 6. Roadmap — what's next
|
||||
|
||||
1. **M3 calibration session (human, next).** Coaches provide a golden set of 10–20
|
||||
known multiplicators, ideally labeled by type. Tune `multipliers.yaml`
|
||||
(sub-score weights, per-tag thresholds — 0.85 currently yields 133/161/10
|
||||
bridger/mentor/amplifier tags; if more amplifier candidates are wanted, introduce
|
||||
per-tag thresholds). Re-run `validate_sample.py` after every change as regression.
|
||||
2. **M4 — read-only serving layer**, once the UI needs it: thin FastAPI router in
|
||||
`inse/multiplicators/` over BOTH indices — `multiplicators_v1` for list views
|
||||
(by tag/bucket/score + per-person evidence) and `multiplicator_networks_v1` for
|
||||
the ego-network visualization (one doc per author: nodes with roles, edges with
|
||||
tie strength/cross-institution flags, ego header — render with echarts force
|
||||
layout; see README "Network visualization index"). Then
|
||||
`./gradlew :service:exportOpenApiSpec` to regenerate the Angular client.
|
||||
3. **Scheduling** — re-run `build.py` per dump refresh (Airflow, like the other
|
||||
crawlers); scores are batch-computed, serving is read-only.
|
||||
4. **Deferred improvements**, in value order:
|
||||
- **ORCID / `ude_persons_1.0` bridge** — the single highest-value follow-up: fixes
|
||||
news linking, catches *split* profiles (the `suspicious_profile` flag only
|
||||
catches merges; one split-profile artifact sits in the current amplifier
|
||||
top-10), and would enable faculty-level bridging via the staff directory.
|
||||
- Per-field percentile cohorts (biologist baselines ≠ sociologist baselines) —
|
||||
decide with coaches.
|
||||
- Project layer as graph edges (consortium co-membership), DFG/Bund signals if a
|
||||
real person-link ever exists.
|
||||
- Committing the module (currently untracked on `feature/find-multipliers`).
|
||||
@@ -1,395 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
extract.py — cohort-aware extraction of the author + work sets from Elasticsearch.
|
||||
|
||||
Canonical home of the extraction logic (spike_audit.py and build.py both use it).
|
||||
|
||||
The author set is a UNION OF TWO QUERIES (a correctness requirement found during the
|
||||
seed audit — group 2 recovers ~4% of authors that group 1 silently drops):
|
||||
|
||||
1. backend_compatible last_known_institutions in the cohort AND a recent
|
||||
cohort affiliation (years >= extraction.affiliation_years_gte)
|
||||
2. empty_last_known_recent recent cohort affiliation but NO last_known_institutions
|
||||
|
||||
The cohort is the list of OpenAlex institution IDs from `cohorts.<primary>.institution_ids`
|
||||
in multiplicators.yaml (falling back to the primary ID alone). This exists because
|
||||
OpenAlex does NOT model university hospitals as lineage children — matching only the
|
||||
primary institution excluded ~2,400 active UDE clinicians.
|
||||
|
||||
The work set is ALL works by those authors, globally (full authorship lists incl.
|
||||
external co-authors — required for the bridging signals), paginated with
|
||||
search_after over an id sort, batched ~250 author IDs per terms query.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import gzip
|
||||
import json
|
||||
import os
|
||||
import time
|
||||
from pathlib import Path
|
||||
from typing import Any, Iterable, Iterator
|
||||
|
||||
import httpx
|
||||
import yaml
|
||||
from dotenv import load_dotenv
|
||||
|
||||
SCRIPT_DIR = Path(__file__).resolve().parent
|
||||
ENV_PATH = SCRIPT_DIR.parent.parent / "src" / "main" / "inse" / ".env"
|
||||
load_dotenv(dotenv_path=ENV_PATH)
|
||||
|
||||
NES_URL = (os.environ.get("ELASTICSEARCH_URL") or "").rstrip("/")
|
||||
NES_KEY = os.environ.get("ELASTICSEARCH_API_KEY") or ""
|
||||
INSE_URL = (os.environ.get("ELASTICSEARCH_INSE_URL") or "").rstrip("/")
|
||||
INSE_KEY = os.environ.get("ELASTICSEARCH_INSE_API_KEY") or ""
|
||||
|
||||
AUTHOR_PAGE_SIZE = 1000
|
||||
AUTHOR_BATCH_SIZE = 250
|
||||
WORK_PAGE_SIZE = 1000
|
||||
REQUEST_TIMEOUT = 180.0
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# ES helpers
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def _headers(api_key: str) -> dict[str, str]:
|
||||
return {
|
||||
"Authorization": f"ApiKey {api_key}",
|
||||
"Content-Type": "application/json",
|
||||
"Accept": "application/json",
|
||||
}
|
||||
|
||||
|
||||
def es_request(
|
||||
client: httpx.Client,
|
||||
method: str,
|
||||
base_url: str,
|
||||
api_key: str,
|
||||
path: str,
|
||||
body: dict[str, Any] | None = None,
|
||||
) -> httpx.Response:
|
||||
url = f"{base_url}/{path.lstrip('/')}"
|
||||
return client.request(
|
||||
method, url, headers=_headers(api_key), json=body, timeout=REQUEST_TIMEOUT
|
||||
)
|
||||
|
||||
|
||||
def es_search(
|
||||
client: httpx.Client, base_url: str, api_key: str, index: str, body: dict[str, Any]
|
||||
) -> dict[str, Any]:
|
||||
response = es_request(client, "POST", base_url, api_key, f"{index}/_search", body)
|
||||
if not response.is_success:
|
||||
raise RuntimeError(
|
||||
f"ES error {response.status_code} for {index}:\n{response.text[:1000]}"
|
||||
)
|
||||
return response.json()
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Config / cohort
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def load_config(path: str | Path) -> dict[str, Any]:
|
||||
with open(path, "r", encoding="utf-8") as f:
|
||||
return yaml.safe_load(f) or {}
|
||||
|
||||
|
||||
def cohort_ids_for(config: dict[str, Any], primary_short_id: str) -> list[str]:
|
||||
cohort = (config.get("cohorts") or {}).get(primary_short_id) or {}
|
||||
ids = cohort.get("institution_ids")
|
||||
return [str(i) for i in ids] if ids else [primary_short_id]
|
||||
|
||||
|
||||
def resolve_institution(client: httpx.Client, institution_id: str) -> dict[str, Any]:
|
||||
"""Look up ror + display_name from openalex-institutions."""
|
||||
short = institution_id.strip().rsplit("/", 1)[-1]
|
||||
full = f"https://openalex.org/{short}"
|
||||
result = es_search(
|
||||
client, NES_URL, NES_KEY, "openalex-institutions",
|
||||
{"size": 1, "query": {"term": {"id": full}}},
|
||||
)
|
||||
hits = result["hits"]["hits"]
|
||||
if not hits:
|
||||
raise SystemExit(f"Institution {full} not found in openalex-institutions.")
|
||||
source = hits[0]["_source"]
|
||||
return {
|
||||
"id": full,
|
||||
"short_id": short,
|
||||
"ror": source.get("ror"),
|
||||
"display_name": source.get("display_name"),
|
||||
}
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Author queries
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def recent_affiliation_filter(
|
||||
insts: list[dict[str, Any]], year_gte: int
|
||||
) -> dict[str, Any]:
|
||||
"""Recent affiliation with ANY cohort institution (matched by id, ror as backup)."""
|
||||
ids = [i["id"] for i in insts]
|
||||
shoulds: list[dict[str, Any]] = [{"terms": {"affiliations.institution.id": ids}}]
|
||||
rors = [i["ror"] for i in insts if i.get("ror")]
|
||||
if rors:
|
||||
shoulds.append({"terms": {"affiliations.institution.ror": rors}})
|
||||
return {
|
||||
"nested": {
|
||||
"path": "affiliations",
|
||||
"query": {
|
||||
"bool": {
|
||||
"filter": [
|
||||
{"bool": {"should": shoulds, "minimum_should_match": 1}},
|
||||
{"range": {"affiliations.years": {"gte": year_gte}}},
|
||||
]
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def last_known_filter(insts: list[dict[str, Any]]) -> dict[str, Any]:
|
||||
return {
|
||||
"nested": {
|
||||
"path": "last_known_institutions",
|
||||
"query": {
|
||||
"terms": {"last_known_institutions.id": [i["id"] for i in insts]}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def last_known_exists_filter() -> dict[str, Any]:
|
||||
return {
|
||||
"nested": {
|
||||
"path": "last_known_institutions",
|
||||
"query": {"exists": {"field": "last_known_institutions.display_name"}},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
AUTHOR_SOURCE = [
|
||||
"id",
|
||||
"display_name",
|
||||
"orcid",
|
||||
"works_count",
|
||||
"cited_by_count",
|
||||
"last_known_institutions",
|
||||
"affiliations",
|
||||
]
|
||||
|
||||
|
||||
def collect_authors(
|
||||
client: httpx.Client,
|
||||
insts: list[dict[str, Any]],
|
||||
affiliation_year_gte: int,
|
||||
) -> dict[str, dict[str, Any]]:
|
||||
groups = {
|
||||
"backend_compatible": {
|
||||
"bool": {
|
||||
"filter": [
|
||||
last_known_filter(insts),
|
||||
recent_affiliation_filter(insts, affiliation_year_gte),
|
||||
]
|
||||
}
|
||||
},
|
||||
"empty_last_known_recent": {
|
||||
"bool": {
|
||||
"filter": [recent_affiliation_filter(insts, affiliation_year_gte)],
|
||||
"must_not": [last_known_exists_filter()],
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
authors: dict[str, dict[str, Any]] = {}
|
||||
for group_name, query in groups.items():
|
||||
search_after = None
|
||||
total = None
|
||||
read = 0
|
||||
while True:
|
||||
body: dict[str, Any] = {
|
||||
"size": AUTHOR_PAGE_SIZE,
|
||||
"track_total_hits": True,
|
||||
"_source": AUTHOR_SOURCE,
|
||||
"query": query,
|
||||
"sort": [{"id": {"order": "asc"}}],
|
||||
}
|
||||
if search_after:
|
||||
body["search_after"] = search_after
|
||||
result = es_search(client, NES_URL, NES_KEY, "openalex-authors", body)
|
||||
hits = result["hits"]["hits"]
|
||||
if total is None:
|
||||
total = result["hits"]["total"]["value"]
|
||||
print(f" [{group_name}] expected {total}")
|
||||
if not hits:
|
||||
break
|
||||
for hit in hits:
|
||||
src = hit["_source"]
|
||||
aid = src.get("id")
|
||||
if not aid:
|
||||
continue
|
||||
if aid not in authors:
|
||||
authors[aid] = {
|
||||
"id": aid,
|
||||
"display_name": src.get("display_name"),
|
||||
"orcid": src.get("orcid"),
|
||||
"works_count": src.get("works_count"),
|
||||
"cited_by_count": src.get("cited_by_count"),
|
||||
"source_sets": [group_name],
|
||||
}
|
||||
elif group_name not in authors[aid]["source_sets"]:
|
||||
authors[aid]["source_sets"].append(group_name)
|
||||
read += 1
|
||||
search_after = hits[-1]["sort"]
|
||||
print(f" [{group_name}] read {read}/{total}")
|
||||
time.sleep(0.05)
|
||||
return authors
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Work queries — FULL authorships, no inner_hits
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
WORK_SOURCE = [
|
||||
"id",
|
||||
"doi",
|
||||
"publication_year",
|
||||
"type",
|
||||
"cited_by_count",
|
||||
"primary_topic.id",
|
||||
"primary_topic.display_name",
|
||||
"primary_topic.field.id",
|
||||
"primary_topic.field.display_name",
|
||||
"authorships.author.id",
|
||||
"authorships.author.display_name",
|
||||
"authorships.author_position",
|
||||
"authorships.is_corresponding",
|
||||
"authorships.institutions.id",
|
||||
"authorships.institutions.display_name",
|
||||
"authorships.institutions.type",
|
||||
"authorships.institutions.country_code",
|
||||
"authorships.institutions.lineage",
|
||||
]
|
||||
|
||||
|
||||
def collect_works(
|
||||
client: httpx.Client, author_ids: list[str], work_year_gte: int
|
||||
) -> dict[str, dict[str, Any]]:
|
||||
works: dict[str, dict[str, Any]] = {}
|
||||
total_batches = (len(author_ids) + AUTHOR_BATCH_SIZE - 1) // AUTHOR_BATCH_SIZE
|
||||
for i in range(0, len(author_ids), AUTHOR_BATCH_SIZE):
|
||||
batch = author_ids[i : i + AUTHOR_BATCH_SIZE]
|
||||
batch_no = i // AUTHOR_BATCH_SIZE + 1
|
||||
search_after = None
|
||||
while True:
|
||||
body: dict[str, Any] = {
|
||||
"size": WORK_PAGE_SIZE,
|
||||
"track_total_hits": True,
|
||||
"_source": WORK_SOURCE,
|
||||
"query": {
|
||||
"bool": {
|
||||
"filter": [
|
||||
{"range": {"publication_year": {"gte": work_year_gte}}},
|
||||
{
|
||||
"nested": {
|
||||
"path": "authorships",
|
||||
"query": {
|
||||
"terms": {"authorships.author.id": batch}
|
||||
},
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
"sort": [{"id": {"order": "asc"}}],
|
||||
}
|
||||
if search_after:
|
||||
body["search_after"] = search_after
|
||||
result = es_search(client, NES_URL, NES_KEY, "openalex-works*", body)
|
||||
hits = result["hits"]["hits"]
|
||||
if not hits:
|
||||
break
|
||||
for hit in hits:
|
||||
src = hit["_source"]
|
||||
wid = src.get("id")
|
||||
if wid and wid not in works:
|
||||
works[wid] = src
|
||||
search_after = hits[-1]["sort"]
|
||||
print(f" work batch {batch_no}/{total_batches}: unique works {len(works)}")
|
||||
time.sleep(0.05)
|
||||
return works
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Cache IO
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def write_jsonl_gz(path: Path, records: Iterable[dict[str, Any]]) -> None:
|
||||
with gzip.open(path, "wt", encoding="utf-8", newline="\n") as f:
|
||||
for record in records:
|
||||
f.write(json.dumps(record, ensure_ascii=True) + "\n")
|
||||
|
||||
|
||||
def read_jsonl_gz(path: Path) -> Iterator[dict[str, Any]]:
|
||||
with gzip.open(path, "rt", encoding="utf-8") as f:
|
||||
for line in f:
|
||||
line = line.strip()
|
||||
if line:
|
||||
yield json.loads(line)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Top-level: extract to cache
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def extract_to_cache(
|
||||
institution_id: str,
|
||||
config: dict[str, Any],
|
||||
cache_dir: Path,
|
||||
force: bool = False,
|
||||
) -> tuple[Path, Path, list[dict[str, Any]]]:
|
||||
"""Extract authors + works for the cohort to jsonl.gz caches.
|
||||
|
||||
Returns (authors_path, works_path, resolved cohort institutions). Reuses an
|
||||
existing cache unless force=True.
|
||||
"""
|
||||
if not NES_URL or not NES_KEY:
|
||||
raise SystemExit(f"Missing NES credentials. Checked {ENV_PATH}")
|
||||
|
||||
short = institution_id.strip().rsplit("/", 1)[-1]
|
||||
cache_dir.mkdir(parents=True, exist_ok=True)
|
||||
authors_path = cache_dir / f"authors_{short}.jsonl.gz"
|
||||
works_path = cache_dir / f"works_{short}.jsonl.gz"
|
||||
|
||||
extraction_cfg = config.get("extraction") or {}
|
||||
affiliation_year_gte = int(extraction_cfg.get("affiliation_years_gte", 2023))
|
||||
work_year_gte = int(extraction_cfg.get("work_year_gte", 1950))
|
||||
|
||||
with httpx.Client() as client:
|
||||
insts = [
|
||||
resolve_institution(client, i) for i in cohort_ids_for(config, short)
|
||||
]
|
||||
print(f"Cohort ({len(insts)} institutions, affiliation years >= {affiliation_year_gte}):")
|
||||
for inst in insts:
|
||||
print(f" {inst['short_id']:<14} {inst['display_name']}")
|
||||
|
||||
if not force and authors_path.exists() and works_path.exists():
|
||||
print("Reusing cached extract (use --force-extract to refresh).")
|
||||
return authors_path, works_path, insts
|
||||
|
||||
print("\nExtracting authors...")
|
||||
authors = collect_authors(client, insts, affiliation_year_gte)
|
||||
write_jsonl_gz(authors_path, authors.values())
|
||||
print(f"Authors: {len(authors)} -> {authors_path}")
|
||||
|
||||
print("\nExtracting works (full authorships)...")
|
||||
works_map = collect_works(client, sorted(authors.keys()), work_year_gte)
|
||||
write_jsonl_gz(works_path, works_map.values())
|
||||
print(f"Works: {len(works_map)} -> {works_path}")
|
||||
|
||||
return authors_path, works_path, insts
|
||||
@@ -1,259 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
graph.py — co-author graph construction for multiplicator detection (M1, Stage C).
|
||||
|
||||
Input: the cached work extract (see spike_audit.py) as plain dicts.
|
||||
Output: plain-Python structures the metrics module consumes:
|
||||
|
||||
- edges: dict[(src, dst)] -> EdgeStats (undirected, src < dst, SHORT author ids)
|
||||
- nodes: dict[author_id] -> NodeStats (per-author aggregates over their works)
|
||||
|
||||
Design constraints (from the M0 spike):
|
||||
- Works with more than `max_authors_per_work` authors (default 50, chosen from the
|
||||
measured p90=17 / p99=144 distribution) are excluded from GRAPH construction only —
|
||||
a 4,839-author consortium paper is not a collaboration signal, but it still counts
|
||||
toward publication years, which are aggregated here in NodeStats for ALL works.
|
||||
- Edge weights follow the plan: sum of decay^(ref_year - year) / (n_authors - 1)
|
||||
per shared work, so recent, small-team collaborations weigh most.
|
||||
- All author/institution ids are shortened ("https://openalex.org/A5..." -> "A5...")
|
||||
to keep the adjacency structures small.
|
||||
|
||||
Everything here is pure computation over plain data — no I/O, no ES — so it is unit
|
||||
testable with hand-built fixtures.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Any, Iterable
|
||||
|
||||
import polars as pl
|
||||
|
||||
OPENALEX_PREFIX = "https://openalex.org/"
|
||||
|
||||
|
||||
def short_id(raw: str | None) -> str | None:
|
||||
if not raw:
|
||||
return None
|
||||
return raw.rsplit("/", 1)[-1] if "/" in raw else raw
|
||||
|
||||
|
||||
@dataclass
|
||||
class EdgeStats:
|
||||
weight: float = 0.0 # decay- and team-size-weighted collaboration strength
|
||||
n_works: int = 0 # raw shared-work count
|
||||
cross_inst_weight: float = 0.0 # weight portion where the pair shared NO institution
|
||||
first_joint_year: int | None = None
|
||||
last_joint_year: int | None = None
|
||||
|
||||
|
||||
@dataclass
|
||||
class NodeStats:
|
||||
display_name: str | None = None
|
||||
is_focal: bool = False # member of the institution author set
|
||||
publication_years: set[int] = field(default_factory=set) # ALL works (uncapped)
|
||||
n_works: int = 0 # ALL works (uncapped)
|
||||
field_counts: dict[str, int] = field(default_factory=dict) # primary_topic.field
|
||||
n_company_works: int = 0 # works with >=1 co-author institution type=company
|
||||
n_typed_works: int = 0 # works where >=1 institution has a non-null type
|
||||
# supervision signature inputs (per work, position-aware; capped works only)
|
||||
n_last_author_works: int = 0
|
||||
last_author_junior_first: list[tuple[str, int]] = field(default_factory=list)
|
||||
# ^ (first_author_id, year) for works where THIS node was last author
|
||||
|
||||
|
||||
@dataclass
|
||||
class Graph:
|
||||
edges: dict[tuple[str, str], EdgeStats]
|
||||
nodes: dict[str, NodeStats]
|
||||
n_works_used: int # works that entered pair generation
|
||||
n_works_capped: int # works excluded by max_authors_per_work
|
||||
ref_year: int # decay reference year
|
||||
|
||||
|
||||
def _work_author_rows(
|
||||
works: Iterable[dict[str, Any]],
|
||||
) -> tuple[list[dict[str, Any]], dict[str, dict[str, Any]]]:
|
||||
"""Flatten works into one row per (work, author) plus per-work metadata."""
|
||||
rows: list[dict[str, Any]] = []
|
||||
work_meta: dict[str, dict[str, Any]] = {}
|
||||
for w in works:
|
||||
wid = short_id(w.get("id"))
|
||||
year = w.get("publication_year")
|
||||
if not wid or not isinstance(year, int):
|
||||
continue
|
||||
authorships = w.get("authorships") or []
|
||||
seen: set[str] = set()
|
||||
work_rows = []
|
||||
has_company = False
|
||||
has_typed = False
|
||||
first_author: str | None = None
|
||||
last_author: str | None = None
|
||||
for a in authorships:
|
||||
aid = short_id((a.get("author") or {}).get("id"))
|
||||
if not aid or aid in seen:
|
||||
continue
|
||||
seen.add(aid)
|
||||
insts = a.get("institutions") or []
|
||||
inst_ids = frozenset(
|
||||
short_id(i.get("id")) for i in insts if i.get("id")
|
||||
)
|
||||
for i in insts:
|
||||
itype = i.get("type")
|
||||
if itype:
|
||||
has_typed = True
|
||||
if itype == "company":
|
||||
has_company = True
|
||||
position = a.get("author_position")
|
||||
if position == "first" and first_author is None:
|
||||
first_author = aid
|
||||
if position == "last":
|
||||
last_author = aid
|
||||
work_rows.append(
|
||||
{
|
||||
"work_id": wid,
|
||||
"year": year,
|
||||
"author_id": aid,
|
||||
"display_name": (a.get("author") or {}).get("display_name"),
|
||||
"inst_ids": inst_ids,
|
||||
}
|
||||
)
|
||||
n_authors = len(seen)
|
||||
field_id = short_id(((w.get("primary_topic") or {}).get("field") or {}).get("id"))
|
||||
work_meta[wid] = {
|
||||
"year": year,
|
||||
"n_authors": n_authors,
|
||||
"field_id": field_id,
|
||||
"has_company": has_company,
|
||||
"has_typed": has_typed,
|
||||
"first_author": first_author,
|
||||
"last_author": last_author,
|
||||
}
|
||||
rows.extend(work_rows)
|
||||
return rows, work_meta
|
||||
|
||||
|
||||
def build_graph(
|
||||
works: Iterable[dict[str, Any]],
|
||||
focal_author_ids: set[str],
|
||||
max_authors_per_work: int = 50,
|
||||
decay: float = 0.8,
|
||||
ref_year: int | None = None,
|
||||
) -> Graph:
|
||||
"""Build the weighted co-author graph and per-author aggregates.
|
||||
|
||||
`focal_author_ids` may contain full URLs or short ids; both are normalized.
|
||||
`ref_year` defaults to the max publication year in the corpus so results are
|
||||
deterministic for a given extract (never wall-clock dependent).
|
||||
"""
|
||||
focal = {short_id(a) for a in focal_author_ids}
|
||||
rows, work_meta = _work_author_rows(works)
|
||||
|
||||
if ref_year is None:
|
||||
ref_year = max((m["year"] for m in work_meta.values()), default=0)
|
||||
|
||||
# ---- node aggregates over ALL works (uncapped) ----
|
||||
nodes: dict[str, NodeStats] = {}
|
||||
for row in rows:
|
||||
aid = row["author_id"]
|
||||
node = nodes.get(aid)
|
||||
if node is None:
|
||||
node = nodes[aid] = NodeStats(
|
||||
display_name=row["display_name"], is_focal=aid in focal
|
||||
)
|
||||
meta = work_meta[row["work_id"]]
|
||||
node.publication_years.add(row["year"])
|
||||
node.n_works += 1
|
||||
if meta["field_id"]:
|
||||
node.field_counts[meta["field_id"]] = (
|
||||
node.field_counts.get(meta["field_id"], 0) + 1
|
||||
)
|
||||
if meta["has_typed"]:
|
||||
node.n_typed_works += 1
|
||||
if meta["has_company"]:
|
||||
node.n_company_works += 1
|
||||
|
||||
# supervision signature (uses author_position; only meaningful on capped works —
|
||||
# "last author" on a 500-author consortium paper is not a supervision signal)
|
||||
for wid, meta in work_meta.items():
|
||||
if not (2 <= meta["n_authors"] <= max_authors_per_work):
|
||||
continue
|
||||
la, fa = meta["last_author"], meta["first_author"]
|
||||
if la and la in nodes:
|
||||
nodes[la].n_last_author_works += 1
|
||||
if fa and fa != la:
|
||||
nodes[la].last_author_junior_first.append((fa, meta["year"]))
|
||||
|
||||
# ---- pair generation via polars self-join (capped works only) ----
|
||||
usable_work_ids = {
|
||||
wid
|
||||
for wid, meta in work_meta.items()
|
||||
if 2 <= meta["n_authors"] <= max_authors_per_work
|
||||
}
|
||||
n_capped = sum(
|
||||
1 for meta in work_meta.values() if meta["n_authors"] > max_authors_per_work
|
||||
)
|
||||
|
||||
pair_rows = [r for r in rows if r["work_id"] in usable_work_ids]
|
||||
edges: dict[tuple[str, str], EdgeStats] = {}
|
||||
if pair_rows:
|
||||
df = pl.DataFrame(
|
||||
{
|
||||
"work_id": [r["work_id"] for r in pair_rows],
|
||||
"author_id": [r["author_id"] for r in pair_rows],
|
||||
}
|
||||
)
|
||||
pairs = (
|
||||
df.join(df, on="work_id", suffix="_b")
|
||||
.filter(pl.col("author_id") < pl.col("author_id_b"))
|
||||
.select("work_id", "author_id", "author_id_b")
|
||||
)
|
||||
# institution sets are tiny per row; resolve shared-institution in Python
|
||||
inst_by_work_author: dict[tuple[str, str], frozenset] = {
|
||||
(r["work_id"], r["author_id"]): r["inst_ids"] for r in pair_rows
|
||||
}
|
||||
for wid, a, b in pairs.iter_rows():
|
||||
meta = work_meta[wid]
|
||||
year = meta["year"]
|
||||
w = (decay ** (ref_year - year)) / (meta["n_authors"] - 1)
|
||||
key = (a, b)
|
||||
e = edges.get(key)
|
||||
if e is None:
|
||||
e = edges[key] = EdgeStats()
|
||||
e.weight += w
|
||||
e.n_works += 1
|
||||
insts_a = inst_by_work_author[(wid, a)]
|
||||
insts_b = inst_by_work_author[(wid, b)]
|
||||
if not (insts_a & insts_b):
|
||||
e.cross_inst_weight += w
|
||||
if e.first_joint_year is None or year < e.first_joint_year:
|
||||
e.first_joint_year = year
|
||||
if e.last_joint_year is None or year > e.last_joint_year:
|
||||
e.last_joint_year = year
|
||||
|
||||
return Graph(
|
||||
edges=edges,
|
||||
nodes=nodes,
|
||||
n_works_used=len(usable_work_ids),
|
||||
n_works_capped=n_capped,
|
||||
ref_year=ref_year,
|
||||
)
|
||||
|
||||
|
||||
def adjacency(graph: Graph) -> dict[str, dict[str, float]]:
|
||||
"""Symmetric weighted adjacency over ALL nodes (focal + external)."""
|
||||
adj: dict[str, dict[str, float]] = {}
|
||||
for (a, b), e in graph.edges.items():
|
||||
adj.setdefault(a, {})[b] = e.weight
|
||||
adj.setdefault(b, {})[a] = e.weight
|
||||
return adj
|
||||
|
||||
|
||||
def focal_subgraph(graph: Graph) -> dict[str, dict[str, float]]:
|
||||
"""Adjacency restricted to focal (institution-internal) nodes only."""
|
||||
adj: dict[str, dict[str, float]] = {}
|
||||
for (a, b), e in graph.edges.items():
|
||||
na, nb = graph.nodes.get(a), graph.nodes.get(b)
|
||||
if na and nb and na.is_focal and nb.is_focal:
|
||||
adj.setdefault(a, {})[b] = e.weight
|
||||
adj.setdefault(b, {})[a] = e.weight
|
||||
return adj
|
||||
@@ -1,272 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
index.py — idempotent indexing of scored multiplicator rows into Elasticsearch.
|
||||
|
||||
Target: the `multiplicators_v1` index on the INSE cluster. The index was created by
|
||||
the cluster admin — the standard API key can read/write/update-mapping but NOT
|
||||
create or delete indices, so this module must never attempt index creation.
|
||||
|
||||
Idempotency: doc _id = "<institution_short>_<author_short>", and every run first
|
||||
deletes the institution's existing docs via a search + bulk-delete-by-id loop.
|
||||
That loop (not _delete_by_query) is deliberate: the same cluster rejects
|
||||
_delete_by_query with 403 for the org_patents key — see
|
||||
inse/patents/org/elastic_search_client.py for the precedent.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import time
|
||||
from datetime import datetime, timezone
|
||||
from typing import Any
|
||||
|
||||
import httpx
|
||||
|
||||
from extract import INSE_KEY, INSE_URL, _headers
|
||||
|
||||
MULTIPLICATORS_INDEX = "multiplicators_v1"
|
||||
NETWORKS_INDEX = "multiplicator_networks_v1"
|
||||
REQUEST_TIMEOUT = 120.0
|
||||
BULK_CHUNK = 500
|
||||
|
||||
MAPPING = {
|
||||
"properties": {
|
||||
"institution_id": {"type": "keyword"},
|
||||
"cohort_institution_ids": {"type": "keyword"},
|
||||
"author_id": {"type": "keyword"},
|
||||
"display_name": {
|
||||
"type": "text",
|
||||
"fields": {"keyword": {"type": "keyword", "ignore_above": 256}},
|
||||
},
|
||||
"career_bucket": {"type": "keyword"},
|
||||
"active_years": {"type": "integer"},
|
||||
"n_works": {"type": "integer"},
|
||||
"suspicious_profile": {"type": "boolean"},
|
||||
"tags": {"type": "keyword"},
|
||||
"max_sub_score": {"type": "float"},
|
||||
"sub_scores": {
|
||||
"properties": {
|
||||
"bridger": {"type": "float"},
|
||||
"mentor": {"type": "float"},
|
||||
"amplifier": {"type": "float"},
|
||||
}
|
||||
},
|
||||
# M3 signal counts
|
||||
"patent_count": {"type": "integer"},
|
||||
"patent_count_name_only": {"type": "integer"}, # evidence only, never scored
|
||||
"news_mentions": {"type": "integer"},
|
||||
"cordis_eu_projects": {"type": "integer"},
|
||||
"industry_coauthor_share_shrunk": {"type": "float"},
|
||||
# raw metrics + percentiles kept as dynamic float objects (calibration needs them)
|
||||
"percentiles": {"type": "object", "dynamic": True},
|
||||
"evidence": {
|
||||
"properties": {"junior_ids": {"type": "keyword"}},
|
||||
},
|
||||
"config_hash": {"type": "keyword"},
|
||||
"computed_at": {"type": "date"},
|
||||
}
|
||||
}
|
||||
|
||||
# Visualization docs: nodes/edges live in _source only ("enabled": false — never
|
||||
# indexed/queried per-field, the frontend GETs whole docs by _id or author filter),
|
||||
# which keeps the index small despite ~900 edge objects per doc.
|
||||
NETWORK_MAPPING = {
|
||||
"properties": {
|
||||
"institution_id": {"type": "keyword"},
|
||||
"cohort_institution_ids": {"type": "keyword"},
|
||||
"author_id": {"type": "keyword"},
|
||||
"display_name": {
|
||||
"type": "text",
|
||||
"fields": {"keyword": {"type": "keyword", "ignore_above": 256}},
|
||||
},
|
||||
"ego": {
|
||||
"properties": {
|
||||
"career_bucket": {"type": "keyword"},
|
||||
"active_years": {"type": "integer"},
|
||||
"n_works": {"type": "integer"},
|
||||
"suspicious_profile": {"type": "boolean"},
|
||||
"tags": {"type": "keyword"},
|
||||
"max_sub_score": {"type": "float"},
|
||||
"sub_scores": {
|
||||
"properties": {
|
||||
"bridger": {"type": "float"},
|
||||
"mentor": {"type": "float"},
|
||||
"amplifier": {"type": "float"},
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
"total_coauthors": {"type": "integer"},
|
||||
"cohort_coauthors": {"type": "integer"},
|
||||
"mentee_count": {"type": "integer"},
|
||||
"shown": {"type": "integer"},
|
||||
"shown_mentees": {"type": "integer"},
|
||||
"nodes": {"type": "object", "enabled": False},
|
||||
"edges": {"type": "object", "enabled": False},
|
||||
"config_hash": {"type": "keyword"},
|
||||
"computed_at": {"type": "date"},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class MultiplicatorsIndexClient:
|
||||
def __init__(
|
||||
self,
|
||||
base_url: str | None = None,
|
||||
api_key: str | None = None,
|
||||
index: str = MULTIPLICATORS_INDEX,
|
||||
transport: httpx.BaseTransport | None = None,
|
||||
):
|
||||
self.base_url = (base_url or INSE_URL).rstrip("/")
|
||||
self.api_key = api_key if api_key is not None else INSE_KEY
|
||||
self.index = index
|
||||
self.client = httpx.Client(transport=transport, timeout=REQUEST_TIMEOUT)
|
||||
if not self.base_url or not self.api_key:
|
||||
raise SystemExit("Missing INSE cluster credentials (ELASTICSEARCH_INSE_*).")
|
||||
|
||||
def _request(self, method: str, path: str, **kwargs: Any) -> httpx.Response:
|
||||
return self.client.request(
|
||||
method,
|
||||
f"{self.base_url}/{path.lstrip('/')}",
|
||||
headers=_headers(self.api_key),
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def ensure_mapping(self, mapping: dict[str, Any] | None = None) -> None:
|
||||
"""PUT the explicit mapping (additive; safe on every run). Never creates the index."""
|
||||
response = self._request(
|
||||
"PUT", f"{self.index}/_mapping", json=mapping or MAPPING
|
||||
)
|
||||
if not response.is_success:
|
||||
raise RuntimeError(
|
||||
f"Mapping update failed ({response.status_code}): {response.text[:500]}"
|
||||
)
|
||||
|
||||
def count_for_institution(self, institution_short_id: str) -> int:
|
||||
response = self._request(
|
||||
"POST",
|
||||
f"{self.index}/_count",
|
||||
json={"query": {"term": {"institution_id": institution_short_id}}},
|
||||
)
|
||||
response.raise_for_status()
|
||||
return response.json()["count"]
|
||||
|
||||
def _wait_for_count(self, institution_short_id: str, expected: int,
|
||||
timeout_s: float = 30.0) -> int:
|
||||
"""Poll _count until it reaches `expected` or timeout.
|
||||
|
||||
The API key is NOT allowed to call _refresh (indices:admin/refresh -> 403),
|
||||
so visibility of deletes/writes depends on the index's auto-refresh
|
||||
(default 1s). Polling is the only verification available to this key."""
|
||||
deadline = time.time() + timeout_s
|
||||
count = -1
|
||||
while time.time() < deadline:
|
||||
count = self.count_for_institution(institution_short_id)
|
||||
if count == expected:
|
||||
return count
|
||||
time.sleep(1.0)
|
||||
return count
|
||||
|
||||
def _collect_ids_for_institution(self, institution_short_id: str) -> list[str]:
|
||||
"""All doc _ids for the institution, paginated with search_after (collected
|
||||
BEFORE any deletes, so stale-visibility cannot inflate or loop the delete)."""
|
||||
ids: list[str] = []
|
||||
search_after = None
|
||||
while True:
|
||||
body: dict[str, Any] = {
|
||||
"size": 1000,
|
||||
"_source": False,
|
||||
"query": {"term": {"institution_id": institution_short_id}},
|
||||
"sort": [{"author_id": {"order": "asc"}}],
|
||||
}
|
||||
if search_after:
|
||||
body["search_after"] = search_after
|
||||
response = self._request("POST", f"{self.index}/_search", json=body)
|
||||
response.raise_for_status()
|
||||
hits = response.json()["hits"]["hits"]
|
||||
if not hits:
|
||||
break
|
||||
ids.extend(h["_id"] for h in hits)
|
||||
search_after = hits[-1]["sort"]
|
||||
return ids
|
||||
|
||||
def delete_for_institution(self, institution_short_id: str) -> int:
|
||||
"""Collect ids, then bulk-delete-by-id (the key rejects _delete_by_query
|
||||
with 403). Returns the number of docs actually deleted."""
|
||||
ids = self._collect_ids_for_institution(institution_short_id)
|
||||
deleted = 0
|
||||
for start in range(0, len(ids), BULK_CHUNK):
|
||||
chunk = ids[start : start + BULK_CHUNK]
|
||||
lines = "".join(
|
||||
json.dumps({"delete": {"_index": self.index, "_id": doc_id}}) + "\n"
|
||||
for doc_id in chunk
|
||||
)
|
||||
bulk = self.client.post(
|
||||
f"{self.base_url}/_bulk",
|
||||
headers={**_headers(self.api_key), "Content-Type": "application/x-ndjson"},
|
||||
content=lines,
|
||||
)
|
||||
bulk.raise_for_status()
|
||||
for item in bulk.json()["items"]:
|
||||
result = item.get("delete", {})
|
||||
if result.get("result") == "deleted":
|
||||
deleted += 1
|
||||
elif result.get("error"):
|
||||
raise RuntimeError(f"Bulk delete error: {result['error']}")
|
||||
if ids:
|
||||
remaining = self._wait_for_count(institution_short_id, 0)
|
||||
if remaining != 0:
|
||||
raise RuntimeError(
|
||||
f"{remaining} docs for {institution_short_id} still visible "
|
||||
f"after delete (expected 0)"
|
||||
)
|
||||
return deleted
|
||||
|
||||
def index_rows(
|
||||
self,
|
||||
institution_short_id: str,
|
||||
cohort_short_ids: list[str],
|
||||
scored_rows: list[dict[str, Any]],
|
||||
) -> int:
|
||||
"""Delete-then-bulk-index all rows for the institution. Returns docs written."""
|
||||
computed_at = datetime.now(timezone.utc).isoformat()
|
||||
deleted = self.delete_for_institution(institution_short_id)
|
||||
print(f"Deleted {deleted} existing docs for {institution_short_id}")
|
||||
|
||||
written = 0
|
||||
for start in range(0, len(scored_rows), BULK_CHUNK):
|
||||
chunk = scored_rows[start : start + BULK_CHUNK]
|
||||
lines = []
|
||||
for row in chunk:
|
||||
doc = {
|
||||
**row,
|
||||
"institution_id": institution_short_id,
|
||||
"cohort_institution_ids": cohort_short_ids,
|
||||
"computed_at": computed_at,
|
||||
}
|
||||
doc_id = f"{institution_short_id}_{row['author_id']}"
|
||||
lines.append(
|
||||
json.dumps({"index": {"_index": self.index, "_id": doc_id}})
|
||||
)
|
||||
lines.append(json.dumps(doc, ensure_ascii=True))
|
||||
bulk = self.client.post(
|
||||
f"{self.base_url}/_bulk",
|
||||
headers={**_headers(self.api_key), "Content-Type": "application/x-ndjson"},
|
||||
content="\n".join(lines) + "\n",
|
||||
)
|
||||
bulk.raise_for_status()
|
||||
result = bulk.json()
|
||||
if result.get("errors"):
|
||||
first_error = next(
|
||||
(i["index"].get("error") for i in result["items"]
|
||||
if i.get("index", {}).get("error")),
|
||||
None,
|
||||
)
|
||||
raise RuntimeError(f"Bulk indexing reported errors, first: {first_error}")
|
||||
written += len(chunk)
|
||||
visible = self._wait_for_count(institution_short_id, written)
|
||||
if visible != written:
|
||||
raise RuntimeError(
|
||||
f"Post-index count mismatch for {institution_short_id}: "
|
||||
f"wrote {written}, index shows {visible} after 30s"
|
||||
)
|
||||
return written
|
||||
@@ -1,264 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
make_report.py — render the ego-network HTML report from the LIVE ES indices.
|
||||
|
||||
Reads `multiplicators_v1` (scores) + `multiplicator_networks_v1` (nodes/edges) —
|
||||
the same two documents a frontend service would fetch — and writes a single
|
||||
self-contained HTML file to reports/. No local cache needed: the report can be
|
||||
regenerated any time after a build, on any machine with cluster access.
|
||||
|
||||
python make_report.py --institution-id I62318514
|
||||
python make_report.py --institution-id I62318514 \
|
||||
--author-ids A5113304257,A5043495754 # explicit cast instead of auto-pick
|
||||
|
||||
By default it picks one showcase per tag (highest bridger / mentor / amplifier)
|
||||
plus the highest-scoring person who just misses the tag threshold — the four
|
||||
contrasting cases that make the metrics legible.
|
||||
|
||||
The force-directed layout is computed here and baked into the file so the report
|
||||
stays dependency-free; a real frontend should instead let echarts' `graph` series
|
||||
lay out the same nodes/edges live.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import math
|
||||
import os
|
||||
import random
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import httpx
|
||||
import yaml
|
||||
from dotenv import load_dotenv
|
||||
|
||||
SCRIPT_DIR = Path(__file__).resolve().parent
|
||||
ENV_PATH = SCRIPT_DIR.parent.parent / "src" / "main" / "inse" / ".env"
|
||||
load_dotenv(dotenv_path=ENV_PATH)
|
||||
|
||||
INSE_URL = (os.environ.get("ELASTICSEARCH_INSE_URL") or "").rstrip("/")
|
||||
INSE_KEY = os.environ.get("ELASTICSEARCH_INSE_API_KEY") or ""
|
||||
SCORES_INDEX = "multiplicators_v1"
|
||||
NETWORKS_INDEX = "multiplicator_networks_v1"
|
||||
|
||||
SCORE_FIELDS = (
|
||||
"author_id", "display_name", "career_bucket", "active_years", "n_works",
|
||||
"suspicious_profile", "tags", "sub_scores", "percentiles", "betweenness",
|
||||
"brokerage", "constraint", "field_entropy", "cross_institution_share",
|
||||
"strength", "n_coauthors", "industry_coauthor_share",
|
||||
"industry_coauthor_share_shrunk", "juniors_mentored",
|
||||
"junior_progression_rate", "mentoring_rate", "last_author_with_junior_first",
|
||||
"patent_count", "news_mentions", "cordis_eu_projects",
|
||||
)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# ES access
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def _headers() -> dict[str, str]:
|
||||
return {"Authorization": f"ApiKey {INSE_KEY}", "Content-Type": "application/json"}
|
||||
|
||||
|
||||
def es_get(client: httpx.Client, index: str, doc_id: str) -> dict | None:
|
||||
r = client.get(f"{INSE_URL}/{index}/_doc/{doc_id}", headers=_headers(), timeout=30)
|
||||
if r.status_code == 404:
|
||||
return None
|
||||
r.raise_for_status()
|
||||
return r.json()["_source"]
|
||||
|
||||
|
||||
def es_search(client: httpx.Client, index: str, body: dict) -> dict:
|
||||
r = client.post(f"{INSE_URL}/{index}/_search", headers=_headers(), json=body, timeout=60)
|
||||
r.raise_for_status()
|
||||
return r.json()
|
||||
|
||||
|
||||
def pick_showcase(client: httpx.Client, institution: str) -> list[tuple[str, str]]:
|
||||
"""(author_id, kind) for the top bridger / mentor / amplifier + top near-miss."""
|
||||
picks: list[tuple[str, str]] = []
|
||||
seen: set[str] = set()
|
||||
for tag in ("bridger", "mentor", "amplifier"):
|
||||
res = es_search(client, SCORES_INDEX, {
|
||||
"size": 5,
|
||||
"_source": ["author_id"],
|
||||
"query": {"bool": {"filter": [
|
||||
{"term": {"institution_id": institution}},
|
||||
{"term": {"tags": tag}},
|
||||
]}},
|
||||
"sort": [{f"sub_scores.{tag}": {"order": "desc"}}],
|
||||
})
|
||||
for hit in res["hits"]["hits"]:
|
||||
aid = hit["_source"]["author_id"]
|
||||
if aid not in seen:
|
||||
picks.append((aid, tag))
|
||||
seen.add(aid)
|
||||
break
|
||||
# highest scorer that carries no tag — shows where the threshold bites
|
||||
res = es_search(client, SCORES_INDEX, {
|
||||
"size": 5,
|
||||
"_source": ["author_id"],
|
||||
"query": {"bool": {
|
||||
"filter": [{"term": {"institution_id": institution}}],
|
||||
"must_not": [{"exists": {"field": "tags"}}],
|
||||
}},
|
||||
"sort": [{"max_sub_score": {"order": "desc"}}],
|
||||
})
|
||||
for hit in res["hits"]["hits"]:
|
||||
aid = hit["_source"]["author_id"]
|
||||
if aid not in seen:
|
||||
picks.append((aid, "example"))
|
||||
seen.add(aid)
|
||||
break
|
||||
return picks
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Layout
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def fr_layout(node_ids, edge_list, w=760, h=560, iters=350, seed=7):
|
||||
"""Fruchterman-Reingold with the ego pinned to the centre (deterministic seed)."""
|
||||
rng = random.Random(seed)
|
||||
pos = {n: [rng.uniform(0, w), rng.uniform(0, h)] for n in node_ids}
|
||||
ego = node_ids[0]
|
||||
pos[ego] = [w / 2, h / 2]
|
||||
k = math.sqrt(w * h / max(len(node_ids), 1)) * 0.9
|
||||
t = w / 8
|
||||
wmax = max((e[2] for e in edge_list), default=1.0)
|
||||
for _ in range(iters):
|
||||
disp = {n: [0.0, 0.0] for n in node_ids}
|
||||
for i, a in enumerate(node_ids):
|
||||
for b in node_ids[i + 1:]:
|
||||
dx = pos[a][0] - pos[b][0]
|
||||
dy = pos[a][1] - pos[b][1]
|
||||
d = max(math.hypot(dx, dy), 0.01)
|
||||
f = k * k / d
|
||||
disp[a][0] += dx / d * f; disp[a][1] += dy / d * f
|
||||
disp[b][0] -= dx / d * f; disp[b][1] -= dy / d * f
|
||||
for a, b, wt in edge_list:
|
||||
dx = pos[a][0] - pos[b][0]
|
||||
dy = pos[a][1] - pos[b][1]
|
||||
d = max(math.hypot(dx, dy), 0.01)
|
||||
f = d * d / k * (0.3 + 0.7 * wt / wmax)
|
||||
disp[a][0] -= dx / d * f; disp[a][1] -= dy / d * f
|
||||
disp[b][0] += dx / d * f; disp[b][1] += dy / d * f
|
||||
for n in node_ids:
|
||||
if n == ego:
|
||||
continue
|
||||
dx, dy = disp[n]
|
||||
d = max(math.hypot(dx, dy), 0.01)
|
||||
pos[n][0] = min(w - 20, max(20, pos[n][0] + dx / d * min(d, t)))
|
||||
pos[n][1] = min(h - 20, max(20, pos[n][1] + dy / d * min(d, t)))
|
||||
t *= 0.97
|
||||
return pos
|
||||
|
||||
|
||||
def compose(client: httpx.Client, institution: str, picks: list[tuple[str, str]]) -> dict:
|
||||
out: dict[str, dict] = {}
|
||||
for author_id, kind in picks:
|
||||
doc_id = f"{institution}_{author_id}"
|
||||
net = es_get(client, NETWORKS_INDEX, doc_id)
|
||||
score = es_get(client, SCORES_INDEX, doc_id)
|
||||
if not net or not score:
|
||||
print(f" skip {author_id}: missing doc", file=sys.stderr)
|
||||
continue
|
||||
node_ids = [n["id"] for n in net["nodes"]]
|
||||
pos = fr_layout(node_ids, [(e["a"], e["b"], e["w"]) for e in net["edges"]])
|
||||
nodes = []
|
||||
for n in net["nodes"]:
|
||||
entry = {
|
||||
"id": n["id"], "name": n["name"], "role": n["role"],
|
||||
"inst": n.get("inst", ""), "active_years": n["active_years"],
|
||||
"x": round(pos[n["id"]][0], 1), "y": round(pos[n["id"]][1], 1),
|
||||
}
|
||||
if n.get("company_insts"):
|
||||
entry["company_insts"] = n["company_insts"]
|
||||
nodes.append(entry)
|
||||
out[author_id] = {
|
||||
"kind": kind,
|
||||
"score_row": {k: score[k] for k in SCORE_FIELDS if k in score},
|
||||
"total_coauthors": net["total_coauthors"],
|
||||
"shown": net["shown"],
|
||||
"nodes": nodes,
|
||||
"edges": [
|
||||
{"a": e["a"], "b": e["b"], "w": e["w"], "n": e["n_works"],
|
||||
"cross": e["cross"], "y0": e["first_year"]}
|
||||
for e in net["edges"]
|
||||
],
|
||||
"config_hash": score.get("config_hash", ""),
|
||||
"computed_at": (score.get("computed_at") or "")[:10],
|
||||
}
|
||||
roles: dict[str, int] = {}
|
||||
for n in nodes:
|
||||
roles[n["role"]] = roles.get(n["role"], 0) + 1
|
||||
print(f" {kind:<10} {score.get('display_name')}: {roles}", file=sys.stderr)
|
||||
return out
|
||||
|
||||
|
||||
TEMPLATE_PATH = SCRIPT_DIR / "report_template.html"
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--institution-id", required=True)
|
||||
parser.add_argument(
|
||||
"--author-ids", default="",
|
||||
help="Comma-separated author IDs to feature. Overrides report.featured_author_ids "
|
||||
"in the config; pass --auto to force automatic selection instead.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--auto", action="store_true",
|
||||
help="Ignore the pinned cast and auto-select the current top scorer per tag.",
|
||||
)
|
||||
parser.add_argument("--config", default=str(SCRIPT_DIR / "multipliers.yaml"))
|
||||
parser.add_argument("--out", default=str(SCRIPT_DIR / "reports" / "multiplier_networks.html"))
|
||||
args = parser.parse_args()
|
||||
|
||||
if not INSE_URL or not INSE_KEY:
|
||||
raise SystemExit(f"Missing INSE credentials. Checked {ENV_PATH}")
|
||||
|
||||
institution = args.institution_id.strip().rsplit("/", 1)[-1]
|
||||
|
||||
# cast precedence: --author-ids > --auto > config pin > automatic
|
||||
pinned: list[str] = []
|
||||
if not args.auto and not args.author_ids:
|
||||
config_path = Path(args.config)
|
||||
if config_path.exists():
|
||||
config = yaml.safe_load(config_path.read_text(encoding="utf-8")) or {}
|
||||
pinned = [
|
||||
str(a) for a in ((config.get("report") or {}).get("featured_author_ids") or [])
|
||||
]
|
||||
|
||||
with httpx.Client() as client:
|
||||
ids = [a.strip() for a in args.author_ids.split(",") if a.strip()] or pinned
|
||||
if ids:
|
||||
kinds = ["bridger", "mentor", "amplifier", "example"]
|
||||
picks = [(a, kinds[i] if i < len(kinds) else "example")
|
||||
for i, a in enumerate(ids)]
|
||||
source = "config-pinned" if pinned and not args.author_ids else "explicit"
|
||||
print(f"Cast ({source}): {[p[0] for p in picks]}", file=sys.stderr)
|
||||
else:
|
||||
picks = pick_showcase(client, institution)
|
||||
print(f"Auto-selected showcase: {[p[0] for p in picks]}", file=sys.stderr)
|
||||
data = compose(client, institution, picks)
|
||||
|
||||
if not data:
|
||||
raise SystemExit("No documents found — has build.py run for this institution?")
|
||||
|
||||
template = TEMPLATE_PATH.read_text(encoding="utf-8")
|
||||
payload = json.dumps(data, ensure_ascii=True)
|
||||
assert "</script" not in payload, "data would break out of the script tag"
|
||||
html = template.replace("__DATA__", payload)
|
||||
|
||||
out_path = Path(args.out)
|
||||
out_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
out_path.write_text(html, encoding="utf-8")
|
||||
print(f"Report -> {out_path} ({len(html):,} bytes, {len(data)} cases)")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,341 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
metrics.py — bridger / mentor metrics for multiplicator detection (M1, Stage D).
|
||||
|
||||
All functions are pure computations over the structures produced by graph.py.
|
||||
|
||||
Career-age foundation (see analysis/career_stage/README.md): first_publication_year is
|
||||
UNRELIABLE at UDE (merged OpenAlex profiles -> debut years like 1893), so nothing here
|
||||
uses it. The robust primitive is the prefix-counted active-year count
|
||||
|
||||
active_years_at(A, Y) = |{ y in distinct_publication_years(A) : y <= Y }|
|
||||
|
||||
which a single misattributed old work moves by exactly 1. It inherits the empirically
|
||||
validated career-stage thresholds from inse/persons/logic.py unchanged.
|
||||
|
||||
Mentor metrics are computed over FOCAL (institution-internal) pairs only: the extract
|
||||
contains the complete global history of focal authors, so their year-sets are exact,
|
||||
while external co-authors' year-sets are truncated to shared works (an external senior
|
||||
would look junior). This scope restriction is a data-correctness requirement, not a
|
||||
modelling choice.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import heapq
|
||||
import math
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
from graph import EdgeStats, Graph, adjacency, focal_subgraph
|
||||
|
||||
|
||||
def incident_edges(graph: Graph) -> dict[str, list[tuple[str, EdgeStats]]]:
|
||||
"""One pass over the edge dict -> per-author incident edge lists.
|
||||
|
||||
Every per-author metric must use this instead of scanning graph.edges —
|
||||
a full-edge scan per focal author is O(E * authors) and does not finish."""
|
||||
incident: dict[str, list[tuple[str, EdgeStats]]] = {}
|
||||
for (a, b), e in graph.edges.items():
|
||||
incident.setdefault(a, []).append((b, e))
|
||||
incident.setdefault(b, []).append((a, e))
|
||||
return incident
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Career primitives
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def active_years_at(publication_years: set[int], year: int) -> int:
|
||||
"""Distinct publication years up to and including `year` (robust seniority)."""
|
||||
return sum(1 for y in publication_years if y <= year)
|
||||
|
||||
|
||||
def is_suspicious_profile(publication_years: set[int]) -> bool:
|
||||
"""Merged-profile flag, same rule as inse/persons/logic.py."""
|
||||
if not publication_years:
|
||||
return False
|
||||
first = min(publication_years)
|
||||
span = max(publication_years) - first + 1
|
||||
return first < 1970 or span > 60
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Betweenness — Brandes (2001), weighted variant with Dijkstra.
|
||||
# Weights are collaboration STRENGTHS; shortest paths need DISTANCES, so we
|
||||
# pass 1/weight (strong ties = short distances). Pure stdlib.
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def betweenness_centrality(
|
||||
adj: dict[str, dict[str, float]], normalized: bool = True
|
||||
) -> dict[str, float]:
|
||||
nodes = list(adj.keys())
|
||||
bc = {v: 0.0 for v in nodes}
|
||||
|
||||
for s in nodes:
|
||||
# single-source shortest paths (Dijkstra on 1/weight distances).
|
||||
# All per-source state is lazy (touched nodes only) — a per-source init
|
||||
# over all V nodes would make the whole thing O(V^2) before any work.
|
||||
dist: dict[str, float] = {s: 0.0}
|
||||
sigma: dict[str, float] = {s: 1.0}
|
||||
preds: dict[str, list[str]] = {}
|
||||
done: set[str] = set()
|
||||
order: list[str] = []
|
||||
heap: list[tuple[float, str]] = [(0.0, s)]
|
||||
while heap:
|
||||
d, v = heapq.heappop(heap)
|
||||
if v in done:
|
||||
continue
|
||||
done.add(v)
|
||||
order.append(v)
|
||||
sigma_v = sigma[v]
|
||||
for u, w in adj[v].items():
|
||||
if w <= 0:
|
||||
continue
|
||||
nd = d + 1.0 / w
|
||||
old = dist.get(u)
|
||||
if old is None or nd < old - 1e-12:
|
||||
dist[u] = nd
|
||||
sigma[u] = sigma_v
|
||||
preds[u] = [v]
|
||||
heapq.heappush(heap, (nd, u))
|
||||
elif abs(nd - old) <= 1e-12 and u not in done:
|
||||
sigma[u] += sigma_v
|
||||
preds.setdefault(u, []).append(v)
|
||||
# accumulation, reverse order of discovery
|
||||
delta: dict[str, float] = {}
|
||||
for v in reversed(order):
|
||||
dv = delta.get(v, 0.0)
|
||||
coeff = (1.0 + dv) / sigma[v]
|
||||
for p in preds.get(v, ()):
|
||||
delta[p] = delta.get(p, 0.0) + sigma[p] * coeff
|
||||
if v != s:
|
||||
bc[v] += dv
|
||||
|
||||
# undirected: each pair counted twice
|
||||
for v in bc:
|
||||
bc[v] /= 2.0
|
||||
if normalized and len(nodes) > 2:
|
||||
scale = 1.0 / ((len(nodes) - 1) * (len(nodes) - 2) / 2.0)
|
||||
for v in bc:
|
||||
bc[v] *= scale
|
||||
return bc
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Burt's constraint — low constraint == structural-hole spanner (bridger).
|
||||
# Computed on the FULL graph (external co-authors included): someone whose
|
||||
# UDE-internal network is dense but who alone connects to industry/abroad
|
||||
# is a bridger that internal betweenness cannot see.
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def burt_constraint(
|
||||
adj: dict[str, dict[str, float]], nodes: list[str] | None = None
|
||||
) -> dict[str, float]:
|
||||
"""Constraint c_i = sum_j (p_ij + sum_q p_iq * p_qj)^2 over neighbours j of i.
|
||||
|
||||
p_ij = w_ij / sum_k w_ik. Isolates get constraint 1.0 (fully constrained).
|
||||
"""
|
||||
# strength totals once — recomputing sum(neigh.values()) inside the O(d^2)
|
||||
# inner loop makes this O(d^3) and unusable on hub nodes
|
||||
totals = {v: sum(neigh.values()) for v, neigh in adj.items()}
|
||||
|
||||
result: dict[str, float] = {}
|
||||
targets = nodes if nodes is not None else list(adj.keys())
|
||||
for i in targets:
|
||||
neigh = adj.get(i) or {}
|
||||
total = totals.get(i, 0.0)
|
||||
if total <= 0:
|
||||
result[i] = 1.0
|
||||
continue
|
||||
p_i = {j: w / total for j, w in neigh.items()}
|
||||
c = 0.0
|
||||
for j, p_ij in p_i.items():
|
||||
indirect = 0.0
|
||||
for q, p_iq in p_i.items():
|
||||
if q == j:
|
||||
continue
|
||||
q_neigh = adj.get(q)
|
||||
if not q_neigh:
|
||||
continue
|
||||
w_qj = q_neigh.get(j)
|
||||
if w_qj:
|
||||
indirect += p_iq * (w_qj / totals[q])
|
||||
c += (p_ij + indirect) ** 2
|
||||
result[i] = c
|
||||
return result
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Simple per-node shares
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def field_entropy(field_counts: dict[str, int]) -> float:
|
||||
"""Shannon entropy (bits) over primary_topic.field of an author's works."""
|
||||
total = sum(field_counts.values())
|
||||
if total <= 0:
|
||||
return 0.0
|
||||
ent = 0.0
|
||||
for c in field_counts.values():
|
||||
if c > 0:
|
||||
p = c / total
|
||||
ent -= p * math.log2(p)
|
||||
return ent
|
||||
|
||||
|
||||
def cross_institution_share(
|
||||
graph: Graph,
|
||||
author_id: str,
|
||||
incident: dict[str, list[tuple[str, EdgeStats]]] | None = None,
|
||||
) -> float:
|
||||
"""Share of an author's edge weight where the pair shared no institution."""
|
||||
if incident is None:
|
||||
incident = incident_edges(graph)
|
||||
total = 0.0
|
||||
cross = 0.0
|
||||
for _, e in incident.get(author_id, ()):
|
||||
total += e.weight
|
||||
cross += e.cross_inst_weight
|
||||
return cross / total if total > 0 else 0.0
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Mentor metrics — debut-year-free (see module docstring)
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
@dataclass
|
||||
class MentorMetrics:
|
||||
juniors_mentored: int = 0
|
||||
junior_progression_rate: float | None = None # None if no juniors
|
||||
last_author_with_junior_first: int = 0
|
||||
mentoring_rate: float = 0.0
|
||||
junior_ids: list[str] = field(default_factory=list) # evidence
|
||||
|
||||
|
||||
def mentor_metrics(
|
||||
graph: Graph,
|
||||
focal_author_id: str,
|
||||
junior_active_years_max: int = 4,
|
||||
senior_active_years_min: int = 10,
|
||||
progressed_active_years_min: int = 5,
|
||||
incident: dict[str, list[tuple[str, EdgeStats]]] | None = None,
|
||||
) -> MentorMetrics:
|
||||
"""Seniority-gap mentorship over focal-internal pairs.
|
||||
|
||||
A co-author J counts as "mentored" when, at the year Y of the FIRST joint work:
|
||||
active_years_at(J, Y) <= junior_active_years_max (J was Early-career)
|
||||
active_years_at(focal, Y) >= senior_active_years_min (focal was Established+)
|
||||
Progression: J later reached >= progressed_active_years_min total active years.
|
||||
"""
|
||||
focal_node = graph.nodes.get(focal_author_id)
|
||||
if focal_node is None:
|
||||
return MentorMetrics()
|
||||
if incident is None:
|
||||
incident = incident_edges(graph)
|
||||
|
||||
juniors: list[str] = []
|
||||
progressed = 0
|
||||
for other, e in incident.get(focal_author_id, ()):
|
||||
if e.first_joint_year is None:
|
||||
continue
|
||||
other_node = graph.nodes.get(other)
|
||||
if other_node is None or not other_node.is_focal or not focal_node.is_focal:
|
||||
continue # internal pairs only — external year-sets are truncated
|
||||
y = e.first_joint_year
|
||||
if (
|
||||
active_years_at(other_node.publication_years, y) <= junior_active_years_max
|
||||
and active_years_at(focal_node.publication_years, y) >= senior_active_years_min
|
||||
):
|
||||
juniors.append(other)
|
||||
if len(other_node.publication_years) >= progressed_active_years_min:
|
||||
progressed += 1
|
||||
|
||||
# supervision signature: focal last author, junior (at that work's year) first author
|
||||
last_author_junior_first = 0
|
||||
for first_author, year in focal_node.last_author_junior_first:
|
||||
fa_node = graph.nodes.get(first_author)
|
||||
if fa_node is None or not fa_node.is_focal:
|
||||
continue
|
||||
if active_years_at(fa_node.publication_years, year) <= junior_active_years_max:
|
||||
last_author_junior_first += 1
|
||||
|
||||
total_active = len(focal_node.publication_years)
|
||||
return MentorMetrics(
|
||||
juniors_mentored=len(juniors),
|
||||
junior_progression_rate=(progressed / len(juniors)) if juniors else None,
|
||||
last_author_with_junior_first=last_author_junior_first,
|
||||
mentoring_rate=(len(juniors) / total_active) if total_active else 0.0,
|
||||
junior_ids=juniors,
|
||||
)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Orchestration: all raw metrics for every focal author
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def compute_all_metrics(
|
||||
graph: Graph,
|
||||
junior_active_years_max: int = 4,
|
||||
senior_active_years_min: int = 10,
|
||||
progressed_active_years_min: int = 5,
|
||||
industry_share_shrinkage_k: int = 5,
|
||||
) -> dict[str, dict]:
|
||||
"""Raw (un-normalized) metric rows keyed by focal author id."""
|
||||
internal = focal_subgraph(graph)
|
||||
full_adj = adjacency(graph)
|
||||
incident = incident_edges(graph)
|
||||
focal_ids = [aid for aid, n in graph.nodes.items() if n.is_focal]
|
||||
|
||||
bc = betweenness_centrality(internal) if internal else {}
|
||||
constraint = burt_constraint(full_adj, nodes=[a for a in focal_ids if a in full_adj])
|
||||
|
||||
rows: dict[str, dict] = {}
|
||||
for aid in focal_ids:
|
||||
node = graph.nodes[aid]
|
||||
mm = mentor_metrics(
|
||||
graph,
|
||||
aid,
|
||||
junior_active_years_max=junior_active_years_max,
|
||||
senior_active_years_min=senior_active_years_min,
|
||||
progressed_active_years_min=progressed_active_years_min,
|
||||
incident=incident,
|
||||
)
|
||||
strength = sum(full_adj.get(aid, {}).values())
|
||||
rows[aid] = {
|
||||
"author_id": aid,
|
||||
"display_name": node.display_name,
|
||||
"active_years": len(node.publication_years),
|
||||
"n_works": node.n_works,
|
||||
"suspicious_profile": is_suspicious_profile(node.publication_years),
|
||||
# bridger
|
||||
"betweenness": bc.get(aid, 0.0),
|
||||
"constraint": constraint.get(aid, 1.0),
|
||||
"brokerage": 1.0 - constraint.get(aid, 1.0), # higher = more bridging
|
||||
"field_entropy": field_entropy(node.field_counts),
|
||||
"cross_institution_share": cross_institution_share(graph, aid, incident),
|
||||
"strength": strength,
|
||||
"n_coauthors": len(full_adj.get(aid, {})),
|
||||
# amplifier inputs available from OpenAlex alone
|
||||
"industry_coauthor_share": (
|
||||
node.n_company_works / node.n_typed_works if node.n_typed_works else 0.0
|
||||
),
|
||||
# shrunk variant for SCORING: n_company/(n_typed+k) damps the small-
|
||||
# denominator artifact where 2-of-2 company works outranks 40-of-80 —
|
||||
# the live index's top "amplifiers" were exactly such ratio artifacts
|
||||
"industry_coauthor_share_shrunk": (
|
||||
node.n_company_works / (node.n_typed_works + industry_share_shrinkage_k)
|
||||
if node.n_typed_works
|
||||
else 0.0
|
||||
),
|
||||
# mentor
|
||||
"juniors_mentored": mm.juniors_mentored,
|
||||
"junior_progression_rate": mm.junior_progression_rate,
|
||||
"last_author_with_junior_first": mm.last_author_with_junior_first,
|
||||
"mentoring_rate": mm.mentoring_rate,
|
||||
"junior_ids": mm.junior_ids,
|
||||
}
|
||||
return rows
|
||||
@@ -1,121 +0,0 @@
|
||||
# Multiplicator detection — all tunables live here.
|
||||
# Coaches will retune weights/thresholds; every output doc carries a config_hash
|
||||
# of this file so scores stay attributable to the weighting that produced them.
|
||||
|
||||
version: 2
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Cohorts — which OpenAlex institutions constitute "the university".
|
||||
#
|
||||
# Keyed by the primary institution ID passed as --institution-id. If a cohort
|
||||
# entry exists, the author set is extracted over ALL listed IDs; otherwise the
|
||||
# primary ID alone is used. Needed because OpenAlex does NOT model university
|
||||
# hospitals as lineage children: Essen University Hospital is only "related"
|
||||
# to UDE, which silently excluded ~2,437 active clinicians (incl. prominent
|
||||
# medicine professors) from the cohort — found via the M1 validation, where
|
||||
# 17/60 hand-labeled people were missing.
|
||||
#
|
||||
# Source of candidates: openalex-institutions `associated_institutions` of the
|
||||
# primary ID (children + related), one hop deep. Every inclusion/exclusion is
|
||||
# a human judgment call — document the reason next to each entry.
|
||||
# ---------------------------------------------------------------------------
|
||||
cohorts:
|
||||
I62318514:
|
||||
name: University of Duisburg-Essen
|
||||
institution_ids:
|
||||
- I62318514 # UDE itself (primary)
|
||||
- I4210119759 # Essen University Hospital — the university medical centre;
|
||||
# "related" in OpenAlex, NOT lineage, hence the coverage gap
|
||||
- I4210161917 # West German Heart and Vascular Center Essen — child of the hospital
|
||||
- I127668822 # Erwin L. Hahn Institute for MRI — joint UDE institute,
|
||||
# isolated in OpenAlex (no lineage/associated links at all)
|
||||
- I4210090139 # Rhein-Ruhr Institut für Sozialforschung (child of UDE)
|
||||
- I4210092428 # Deutsches Textilforschungszentrum Nord-West (child of UDE)
|
||||
- I4210110714 # Institute for Advanced Study in the Humanities Essen / KWI (child)
|
||||
- I4210146441 # The Hydrogen and Fuel Cell Center / ZBT (child of UDE)
|
||||
- I4210154243 # Institut für Energie- und Umwelttechnik / IUTA (child of UDE)
|
||||
# Deliberately EXCLUDED (decide with the coaches before enabling):
|
||||
# - I4210146447 Kliniken Essen-Mitte — independent hospital group, only
|
||||
# "related"; staff are not UDE researchers (~788 authors)
|
||||
# - I2799342142 Salomon Ludwig Steinheim-Institut — independent An-Institut
|
||||
# - I4210124583 IWW Water Centre — independent An-Institut
|
||||
|
||||
extraction:
|
||||
# "Recent affiliation" cutoff for the author set. 2023 (not the current year):
|
||||
# publication lag pushes current staff out of a 1-year window — the M1 validation
|
||||
# found 6 current-ish people (incl. an active professor) with newest affiliation
|
||||
# year 2021-2024. 2023 captures normal lag while still excluding long-departed.
|
||||
affiliation_years_gte: 2023
|
||||
work_year_gte: 1950
|
||||
# Chosen from the M0 spike (authors/work p50=5, p90=17, p99=144, max=4839):
|
||||
# cap 50 keeps >=99% of works and excludes only true hyperauthorship, which
|
||||
# carries no collaboration signal but would create giant artificial cliques.
|
||||
max_authors_per_work: 50
|
||||
|
||||
graph:
|
||||
decay: 0.8 # per-year edge weight decay (ref = newest corpus year)
|
||||
|
||||
career:
|
||||
# active_years bucket thresholds — mirror inse/persons/logic.py _classify_career_stage.
|
||||
# Buckets: Early <= 4, Emerging <= 9, Established <= 14, Senior > 14.
|
||||
buckets: [4, 9, 14]
|
||||
bucket_names: [Early, Emerging, Established, Senior]
|
||||
|
||||
mentor:
|
||||
junior_active_years_max: 4 # junior == Early-career at first joint work
|
||||
senior_active_years_min: 10 # focal must be Established+ at first joint work
|
||||
progressed_active_years_min: 5
|
||||
|
||||
signals:
|
||||
# org_patents match_types that count toward the score; "name"-only matches are
|
||||
# carried as evidence (patent_count_name_only) but never scored.
|
||||
patent_match_types: [institution, both]
|
||||
news_require_relevant: true # only aktuell_postproc docs the LLM marked relevant
|
||||
# Shrinkage constant for industry_coauthor_share_shrunk = company/(typed+k):
|
||||
# damps small denominators (2-of-2 works with a company co-author is not a
|
||||
# stronger industry signal than 40-of-80). Found via the live-index audit,
|
||||
# where all top-10 "amplifiers" were such ratio artifacts.
|
||||
industry_share_shrinkage_k: 5
|
||||
|
||||
network:
|
||||
# Per-author ego-network docs for the visualization frontend
|
||||
# (index multiplicator_networks_v1). Nodes shown = strongest co-authors by tie
|
||||
# weight, with mentees force-included first — their decayed, team-size-divided
|
||||
# ties otherwise never make the cut (a 100-mentee professor had ZERO mentees
|
||||
# in his unforced top 42).
|
||||
max_nodes: 42
|
||||
max_forced_mentees: 14
|
||||
|
||||
# Sub-score weights over WITHIN-BUCKET percentiles of the raw metrics.
|
||||
# Weights within each sub-score should sum to 1.
|
||||
weights:
|
||||
bridger:
|
||||
betweenness: 0.35
|
||||
brokerage: 0.25 # 1 - Burt constraint, full graph incl. externals
|
||||
field_entropy: 0.20
|
||||
cross_institution_share: 0.20
|
||||
mentor:
|
||||
juniors_mentored: 0.35
|
||||
mentoring_rate: 0.25
|
||||
last_author_with_junior_first: 0.25
|
||||
junior_progression_rate: 0.15
|
||||
amplifier:
|
||||
industry_coauthor_share_shrunk: 0.50 # primary: ID-linked company co-authorship, shrunk
|
||||
patent_count: 0.25 # high-confidence org_patents (institution/both)
|
||||
cordis_eu_projects: 0.15 # DOI-join, no name matching
|
||||
news_mentions: 0.10 # normalized-exact name match — lossy; keep low
|
||||
|
||||
tags:
|
||||
threshold: 0.85 # tag fires when sub-score >= threshold (multiple allowed)
|
||||
min_active_years: 2 # never tag someone with <2 active years (no history)
|
||||
|
||||
report:
|
||||
# Cast for make_report.py, in order: bridger, mentor, amplifier, near-miss.
|
||||
# Pinned so the report is reproducible — without this the script auto-picks the
|
||||
# current top scorer per tag, which changes with every weight tune or dump refresh.
|
||||
# Remove/empty the list to fall back to automatic selection.
|
||||
featured_author_ids:
|
||||
- A5113304257 # Jan Egger — top bridger
|
||||
- A5043495754 # Cornelius Deuschl — top mentor
|
||||
- A5007801159 # Jens Wiltfang — top amplifier
|
||||
- A5043360678 # Tabea M. G. Pakull — strong profile just below the tag line
|
||||
@@ -1,161 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
networks.py — materialize per-author ego-network documents for visualization.
|
||||
|
||||
The scores index answers "what did this person score"; the network index answers
|
||||
"who are they connected to and how" — the data a frontend needs to draw the
|
||||
ego-network figures (force layout, role colors, tooltips). The neighbor-neighbor
|
||||
edges that make graph shape readable (dense mesh = one community, spokes with gaps
|
||||
= brokered structural holes) come from works that do NOT include the ego, so they
|
||||
can only be materialized here, while the full graph is in memory — no request-time
|
||||
query can reconstruct them.
|
||||
|
||||
Doc shape (one per focal author, _id = <institution>_<author>):
|
||||
|
||||
nodes[] {id, name, role, inst, active_years, suspicious}
|
||||
role: ego | mentee | cohort | industry | external
|
||||
edges[] {a, b, w, n_works, cross, first_year, last_year}
|
||||
w = decayed collaboration strength; cross = mostly cross-institution
|
||||
ego{} small header duplicate (bucket, tags, sub_scores) so the network
|
||||
endpoint can render standalone
|
||||
totals total_coauthors, cohort_coauthors, shown
|
||||
|
||||
Node selection: the ego's strongest `max_nodes` co-authors by tie weight, with up
|
||||
to `max_forced_mentees` mentees force-included first — mentees' ties are decayed
|
||||
and team-size-divided, so a pure top-by-weight cut hides exactly the people the
|
||||
mentor score is about (empirically: a 100-mentee professor had zero mentees in his
|
||||
unforced top 42). Positions are NOT stored — the frontend's force layout
|
||||
(e.g. echarts `graph` series) lays out at render time.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from graph import Graph
|
||||
from metrics import is_suspicious_profile
|
||||
|
||||
|
||||
def build_network_docs(
|
||||
graph: Graph,
|
||||
metric_rows: dict[str, dict[str, Any]],
|
||||
scored_rows: list[dict[str, Any]],
|
||||
incident: dict[str, list],
|
||||
inst_by_author: dict[str, str],
|
||||
company_by_author_work: dict[str, dict[str, list[str]]],
|
||||
company_work_authors: dict[str, set[str]],
|
||||
max_nodes: int = 42,
|
||||
max_forced_mentees: int = 14,
|
||||
) -> list[dict[str, Any]]:
|
||||
"""One visualization doc per focal author.
|
||||
|
||||
metric_rows must still carry the FULL `junior_ids` (pre-scoring; the scored
|
||||
rows' evidence list is capped). scored_rows supply the ego header fields.
|
||||
|
||||
Industry roles are TIE-LEVEL, not lifetime: a neighbour is marked `industry`
|
||||
only if a company affiliation of theirs appears on a work SHARED with the ego
|
||||
— matching what `industry_coauthor_share` counts. (The first version flagged
|
||||
anyone who ever had a company affiliation anywhere in the corpus, which
|
||||
painted predominantly-academic people orange over one dual affiliation from
|
||||
years ago, with a university name in the tooltip contradicting the colour.)
|
||||
The triggering company names ship on the node as `company_insts`, and
|
||||
`inst_by_author` should be the author's MOST FREQUENT institution so the
|
||||
default label matches reality.
|
||||
"""
|
||||
scored_by_id = {r["author_id"]: r for r in scored_rows}
|
||||
docs: list[dict[str, Any]] = []
|
||||
|
||||
for ego_id, mrow in metric_rows.items():
|
||||
srow = scored_by_id.get(ego_id)
|
||||
if srow is None:
|
||||
continue
|
||||
mentees = set(mrow.get("junior_ids") or [])
|
||||
ranked = sorted(
|
||||
incident.get(ego_id, []), key=lambda kv: kv[1].weight, reverse=True
|
||||
)
|
||||
|
||||
mentee_picks = [n for n, _ in ranked if n in mentees][:max_forced_mentees]
|
||||
forced = set(mentee_picks)
|
||||
others = [n for n, _ in ranked if n not in forced]
|
||||
selected = [ego_id] + mentee_picks + others[: max_nodes - len(mentee_picks)]
|
||||
idset = set(selected)
|
||||
|
||||
nodes = []
|
||||
for nid in selected:
|
||||
node = graph.nodes[nid]
|
||||
# company evidence ON WORKS SHARED WITH THE EGO only
|
||||
shared_companies: set[str] = set()
|
||||
for wid, names in (company_by_author_work.get(nid) or {}).items():
|
||||
if ego_id in company_work_authors.get(wid, ()):
|
||||
shared_companies.update(names)
|
||||
if nid == ego_id:
|
||||
role = "ego"
|
||||
elif nid in mentees:
|
||||
role = "mentee"
|
||||
elif shared_companies and not node.is_focal:
|
||||
role = "industry"
|
||||
elif node.is_focal:
|
||||
role = "cohort"
|
||||
else:
|
||||
role = "external"
|
||||
entry = {
|
||||
"id": nid,
|
||||
"name": node.display_name,
|
||||
"role": role,
|
||||
"inst": inst_by_author.get(nid, ""),
|
||||
"active_years": len(node.publication_years),
|
||||
"suspicious": is_suspicious_profile(node.publication_years),
|
||||
}
|
||||
if shared_companies:
|
||||
# the receipts for the industry colour (also kept on cohort/
|
||||
# mentee nodes so tooltips can show the industry link)
|
||||
entry["company_insts"] = sorted(shared_companies)
|
||||
nodes.append(entry)
|
||||
|
||||
# all corpus edges among the selected nodes — pair lookups against the
|
||||
# edge dict (~900 per ego), NOT a scan of the 5.8M-edge dict per ego
|
||||
edges = []
|
||||
for i, a in enumerate(selected):
|
||||
for b in selected[i + 1:]:
|
||||
e = graph.edges.get((a, b) if a < b else (b, a))
|
||||
if e is None:
|
||||
continue
|
||||
edges.append(
|
||||
{
|
||||
"a": a,
|
||||
"b": b,
|
||||
"w": round(e.weight, 3),
|
||||
"n_works": e.n_works,
|
||||
"cross": bool(
|
||||
e.weight > 0 and e.cross_inst_weight / e.weight > 0.5
|
||||
),
|
||||
"first_year": e.first_joint_year,
|
||||
"last_year": e.last_joint_year,
|
||||
}
|
||||
)
|
||||
|
||||
cohort_coauthors = sum(
|
||||
1 for n, _ in ranked if graph.nodes[n].is_focal
|
||||
)
|
||||
docs.append(
|
||||
{
|
||||
"author_id": ego_id,
|
||||
"display_name": srow.get("display_name"),
|
||||
"ego": {
|
||||
"career_bucket": srow.get("career_bucket"),
|
||||
"active_years": srow.get("active_years"),
|
||||
"n_works": srow.get("n_works"),
|
||||
"suspicious_profile": srow.get("suspicious_profile"),
|
||||
"tags": srow.get("tags", []),
|
||||
"sub_scores": srow.get("sub_scores", {}),
|
||||
"max_sub_score": srow.get("max_sub_score"),
|
||||
},
|
||||
"total_coauthors": len(ranked),
|
||||
"cohort_coauthors": cohort_coauthors,
|
||||
"mentee_count": len(mentees),
|
||||
"shown": len(selected) - 1,
|
||||
"shown_mentees": len(mentee_picks),
|
||||
"nodes": nodes,
|
||||
"edges": edges,
|
||||
}
|
||||
)
|
||||
return docs
|
||||
@@ -1,461 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Multipliers, drawn as networks</title>
|
||||
<style>
|
||||
:root {
|
||||
--surface: #fcfcfb;
|
||||
--surface-2: #f4f3f0;
|
||||
--ink: #0b0b0b;
|
||||
--ink-2: #52514e;
|
||||
--ink-3: #8a8983;
|
||||
--line: #e4e2dc;
|
||||
--ego: #e87ba4;
|
||||
--cohort: #2a78d6;
|
||||
--mentee: #1baf7a;
|
||||
--industry: #eb6834;
|
||||
--external: #b5b4ac;
|
||||
--bar: #2a78d6;
|
||||
--node-stroke: rgba(11,11,11,.35);
|
||||
color-scheme: light;
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root:not([data-theme="light"]) {
|
||||
--surface: #1a1a19;
|
||||
--surface-2: #232322;
|
||||
--ink: #ffffff;
|
||||
--ink-2: #c3c2b7;
|
||||
--ink-3: #8a8983;
|
||||
--line: #3a3936;
|
||||
--ego: #d55181;
|
||||
--cohort: #3987e5;
|
||||
--mentee: #199e70;
|
||||
--industry: #d95926;
|
||||
--external: #55544f;
|
||||
--bar: #3987e5;
|
||||
--node-stroke: rgba(255,255,255,.35);
|
||||
color-scheme: dark;
|
||||
}
|
||||
}
|
||||
:root[data-theme="dark"] {
|
||||
--surface: #1a1a19;
|
||||
--surface-2: #232322;
|
||||
--ink: #ffffff;
|
||||
--ink-2: #c3c2b7;
|
||||
--ink-3: #8a8983;
|
||||
--line: #3a3936;
|
||||
--ego: #d55181;
|
||||
--cohort: #3987e5;
|
||||
--mentee: #199e70;
|
||||
--industry: #d95926;
|
||||
--external: #55544f;
|
||||
--bar: #3987e5;
|
||||
--node-stroke: rgba(255,255,255,.35);
|
||||
color-scheme: dark;
|
||||
}
|
||||
:root[data-theme="light"] {
|
||||
--surface: #fcfcfb;
|
||||
--surface-2: #f4f3f0;
|
||||
--ink: #0b0b0b;
|
||||
--ink-2: #52514e;
|
||||
--ink-3: #8a8983;
|
||||
--line: #e4e2dc;
|
||||
--ego: #e87ba4;
|
||||
--cohort: #2a78d6;
|
||||
--mentee: #1baf7a;
|
||||
--industry: #eb6834;
|
||||
--external: #b5b4ac;
|
||||
--bar: #2a78d6;
|
||||
--node-stroke: rgba(11,11,11,.35);
|
||||
color-scheme: light;
|
||||
}
|
||||
|
||||
body {
|
||||
background: var(--surface);
|
||||
color: var(--ink);
|
||||
font-family: Charter, Georgia, 'Times New Roman', serif;
|
||||
line-height: 1.55;
|
||||
margin: 0;
|
||||
}
|
||||
.wrap { max-width: 1160px; margin: 0 auto; padding: 40px 24px 80px; }
|
||||
|
||||
header.page { max-width: 70ch; margin-bottom: 12px; }
|
||||
.eyebrow {
|
||||
font-family: -apple-system, 'Segoe UI', sans-serif;
|
||||
font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
|
||||
color: var(--ink-3); margin: 0 0 10px;
|
||||
}
|
||||
h1 { font-size: 34px; line-height: 1.15; margin: 0 0 12px; text-wrap: balance; font-weight: 700; }
|
||||
.lede { color: var(--ink-2); font-size: 16.5px; margin: 0; }
|
||||
|
||||
.legend {
|
||||
position: sticky; top: 0; z-index: 5;
|
||||
background: var(--surface);
|
||||
border-block: 1px solid var(--line);
|
||||
margin: 28px 0 0;
|
||||
padding: 10px 2px;
|
||||
display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center;
|
||||
font-family: -apple-system, 'Segoe UI', sans-serif; font-size: 12.5px; color: var(--ink-2);
|
||||
}
|
||||
.legend .li { display: inline-flex; align-items: center; gap: 7px; }
|
||||
.dot { width: 11px; height: 11px; border-radius: 50%; border: 1px solid var(--node-stroke); flex: none; }
|
||||
.dot.ego { outline: 2px solid var(--ink); outline-offset: 1.5px; }
|
||||
.edge-sample { width: 26px; height: 0; border-top: 2px solid var(--ink-3); flex: none; }
|
||||
.edge-sample.dashed { border-top-style: dashed; }
|
||||
|
||||
section.case { margin-top: 52px; }
|
||||
.case-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 14px; margin-bottom: 4px; }
|
||||
.case-eyebrow { font-family: -apple-system,'Segoe UI',sans-serif; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; margin: 0; }
|
||||
h2 { font-size: 26px; margin: 0; font-weight: 700; }
|
||||
.pill {
|
||||
font-family: -apple-system,'Segoe UI',sans-serif; font-size: 11.5px; font-weight: 600;
|
||||
padding: 2.5px 10px; border-radius: 999px; letter-spacing: .04em;
|
||||
border: 1px solid var(--line); color: var(--ink-2); background: var(--surface-2);
|
||||
}
|
||||
.pill.tag { color: var(--surface); border: none; }
|
||||
.meta-line { font-family: -apple-system,'Segoe UI',sans-serif; font-size: 13px; color: var(--ink-3); margin: 2px 0 18px; }
|
||||
|
||||
.case-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 26px; align-items: start; }
|
||||
@media (max-width: 900px) { .case-grid { grid-template-columns: 1fr; } }
|
||||
|
||||
.netbox { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); overflow: hidden; }
|
||||
.netbox svg { display: block; width: 100%; height: auto; }
|
||||
.netfoot { font-family: -apple-system,'Segoe UI',sans-serif; font-size: 12px; color: var(--ink-3); padding: 8px 12px; border-top: 1px solid var(--line); }
|
||||
|
||||
.panel { display: flex; flex-direction: column; gap: 18px; }
|
||||
.panel h3 {
|
||||
font-family: -apple-system,'Segoe UI',sans-serif; font-size: 11px; letter-spacing: .12em;
|
||||
text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; font-weight: 600;
|
||||
}
|
||||
.scorebar { display: grid; grid-template-columns: 74px 1fr 44px; align-items: center; gap: 10px; margin-bottom: 7px;
|
||||
font-family: -apple-system,'Segoe UI',sans-serif; font-size: 12.5px; }
|
||||
.scorebar .nm { color: var(--ink-2); }
|
||||
.scorebar .val { font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); }
|
||||
.track { position: relative; height: 10px; background: var(--surface-2); border-radius: 4px; border: 1px solid var(--line); }
|
||||
.fill { position: absolute; inset: 0 auto 0 0; border-radius: 4px 3px 3px 4px; background: var(--bar); opacity: .55; }
|
||||
.fill.lead { opacity: 1; }
|
||||
.thresh { position: absolute; top: -3px; bottom: -3px; left: 85%; width: 0; border-left: 2px dashed var(--ink-3); }
|
||||
|
||||
table.mx { border-collapse: collapse; width: 100%; font-family: -apple-system,'Segoe UI',sans-serif; font-size: 12.5px; }
|
||||
table.mx th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 8px 0 4px; }
|
||||
table.mx td { padding: 3.5px 0; border-top: 1px solid var(--line); color: var(--ink-2); }
|
||||
table.mx td.num { font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); white-space: nowrap; }
|
||||
table.mx td.num.hot { font-weight: 700; }
|
||||
|
||||
.reading { max-width: 72ch; margin-top: 18px; font-size: 15.5px; color: var(--ink-2); }
|
||||
.reading strong { color: var(--ink); }
|
||||
|
||||
.tooltip {
|
||||
position: fixed; pointer-events: none; z-index: 20; display: none;
|
||||
background: var(--ink); color: var(--surface);
|
||||
font-family: -apple-system,'Segoe UI',sans-serif; font-size: 12px; line-height: 1.45;
|
||||
padding: 8px 11px; border-radius: 7px; max-width: 260px; box-shadow: 0 4px 14px rgba(0,0,0,.25);
|
||||
}
|
||||
.tooltip .t-name { font-weight: 700; }
|
||||
.tooltip .t-dim { opacity: .75; }
|
||||
|
||||
footer.page { margin-top: 60px; border-top: 1px solid var(--line); padding-top: 16px;
|
||||
font-family: -apple-system,'Segoe UI',sans-serif; font-size: 12.5px; color: var(--ink-3); max-width: 78ch; }
|
||||
svg .node { cursor: pointer; }
|
||||
#themeToggle {
|
||||
position: fixed; top: 14px; right: 14px; z-index: 30;
|
||||
font-family: -apple-system,'Segoe UI',sans-serif; font-size: 12px; padding: 6px 12px;
|
||||
border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2);
|
||||
color: var(--ink-2); cursor: pointer;
|
||||
}
|
||||
#themeToggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="wrap">
|
||||
<header class="page">
|
||||
<p class="eyebrow" id="topline">Smart-Guide · Multiplier detection</p>
|
||||
<h1>Four researchers, drawn as the networks that scored them</h1>
|
||||
<p class="lede">
|
||||
Each figure shows one person (ringed) and their strongest co-authors, with every
|
||||
collaboration the corpus records <em>among</em> those co-authors. The shape is the
|
||||
metric: spokes that don't touch are brokered structural holes; a dense mesh is a
|
||||
tight community; green marks the juniors a mentor brought up; orange marks a
|
||||
company link on the works shared with that person. Hover any node for its details.
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<div class="legend" id="legend">
|
||||
<span class="li"><span class="dot ego" style="background:var(--ego)"></span>the person (ego)</span>
|
||||
<span class="li"><span class="dot" style="background:var(--cohort)"></span>cohort co-author</span>
|
||||
<span class="li"><span class="dot" style="background:var(--mentee)"></span>their mentee (junior at first joint paper)</span>
|
||||
<span class="li"><span class="dot" style="background:var(--industry)"></span>company link on works shared with the ego</span>
|
||||
<span class="li"><span class="dot" style="background:var(--external)"></span>external academic</span>
|
||||
<span class="li"><span class="edge-sample"></span>collaboration (width = decayed strength)</span>
|
||||
<span class="li"><span class="edge-sample dashed"></span>mostly cross-institution</span>
|
||||
<span class="li">node size = active years</span>
|
||||
</div>
|
||||
|
||||
<div id="cases"></div>
|
||||
|
||||
<footer class="page">
|
||||
Data: OpenAlex works of the institution cohort (works ≤ 50 authors enter the graph;
|
||||
edge strength decays 0.8/year), read from the <code>multiplicators_v1</code> and
|
||||
<code>multiplicator_networks_v1</code> indices. Networks show each ego's strongest
|
||||
co-authors — totals are given per figure. Scores are percentile-normalized within
|
||||
career buckets; tag threshold 0.85. Config <span id="cfg"></span>, computed
|
||||
<span id="ts"></span>. Mentee marking uses the seniority-gap rule and is restricted
|
||||
to cohort members; external co-authors' histories are truncated to shared works, so
|
||||
their node size is a lower bound. An orange node means a company affiliation appeared
|
||||
on a work shared with the ego — the company is named in the tooltip.
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<div class="tooltip" id="tip"></div>
|
||||
<button id="themeToggle" aria-label="Toggle color theme">theme</button>
|
||||
|
||||
<script>
|
||||
const DATA = __DATA__;
|
||||
|
||||
const ROLE = { ego:'--ego', cohort:'--cohort', mentee:'--mentee', industry:'--industry', external:'--external' };
|
||||
const ORDER = ['bridger','mentor','amplifier','example'];
|
||||
const EYEBROW = {
|
||||
bridger: ['Case 1 — the bridger archetype', '--cohort'],
|
||||
mentor: ['Case 2 — the mentor archetype', '--mentee'],
|
||||
amplifier:['Case 3 — the amplifier archetype', '--industry'],
|
||||
example: ['Case 4 — a strong profile below the tag line', '--ego'],
|
||||
};
|
||||
const ROLE_LABEL = {
|
||||
ego: 'This case’s subject',
|
||||
cohort: 'Cohort co-author',
|
||||
mentee: 'Mentee — junior at first joint paper',
|
||||
industry: 'Company link on shared works',
|
||||
external: 'External academic',
|
||||
};
|
||||
|
||||
const fmt = (v, d=2) => v == null ? '—' : (+v).toFixed(d);
|
||||
const pct = v => v == null ? '—' : Math.round(v*100) + '%';
|
||||
|
||||
function readingFor(kind, r, d) {
|
||||
const p = r.percentiles || {};
|
||||
if (kind === 'bridger') return `
|
||||
<strong>${r.display_name}</strong> holds the cohort's highest bridger score
|
||||
(<strong>${fmt(r.sub_scores.bridger,3)}</strong>). The picture explains it: the
|
||||
${d.total_coauthors} co-authors split into groups that barely touch except through
|
||||
the ego — brokerage ${fmt(r.brokerage,2)} (${pct(p.brokerage)} of the career
|
||||
bucket), ${pct(r.cross_institution_share)} of collaboration weight crosses
|
||||
institutions (dashed edges), and betweenness sits at the ${pct(p.betweenness)}
|
||||
percentile. Where the mentor's figure below is one dense mesh, this one is spokes
|
||||
and gaps — the gaps <em>are</em> the structural holes.`;
|
||||
if (kind === 'mentor') return `
|
||||
<strong>${r.display_name}</strong> tops the mentor ranking
|
||||
(<strong>${fmt(r.sub_scores.mentor,3)}</strong>) with ${r.juniors_mentored} cohort
|
||||
co-authors who were Early-career at their first joint paper while the ego was
|
||||
already Established — the green nodes — plus ${r.last_author_with_junior_first}
|
||||
papers in the classic supervision configuration (ego last author, a junior first).
|
||||
The mesh is dense: this is one connected group, the opposite structure of the
|
||||
bridger above. Only the ${d.shown} strongest ties of ${d.total_coauthors} are drawn.`;
|
||||
if (kind === 'amplifier') return `
|
||||
<strong>${r.display_name}</strong> tops the amplifier ranking
|
||||
(<strong>${fmt(r.sub_scores.amplifier,3)}</strong>) on converging independent
|
||||
channels: ${r.patent_count} high-confidence patent${r.patent_count===1?'':'s'},
|
||||
${r.cordis_eu_projects} EU project${r.cordis_eu_projects===1?'':'s'} via DOI
|
||||
overlap, ${r.news_mentions} press mention${r.news_mentions===1?'':'s'}, and a
|
||||
shrunk industry co-authorship share of ${fmt(r.industry_coauthor_share_shrunk,2)}
|
||||
(${pct(p.industry_coauthor_share_shrunk)} of the bucket). With
|
||||
${d.total_coauthors.toLocaleString('en')} total co-authors only the strongest
|
||||
${d.shown} are drawn — orange nodes carry a company affiliation on the shared work.`;
|
||||
const best = Math.max(...Object.values(r.sub_scores));
|
||||
const bestName = Object.entries(r.sub_scores).sort((a,b)=>b[1]-a[1])[0][0];
|
||||
const gated = best >= 0.85;
|
||||
return `
|
||||
<strong>${r.display_name}</strong> is the system's honest edge case: the
|
||||
highest-scoring person who still carries <strong>no tag</strong>. The ${bestName}
|
||||
sub-score reaches ${fmt(best,3)} ${gated
|
||||
? `— <em>above</em> the 0.85 line. The tag is withheld by the
|
||||
<code>min_active_years</code> guard: ${r.active_years} active
|
||||
year${r.active_years===1?'':'s'} is too thin a history to rank on, and a
|
||||
high score on one year is the signature of a <em>split</em> OpenAlex profile
|
||||
— a fragment of someone's record carrying a share of their patents, press or
|
||||
industry ties. The guard catches what <code>suspicious_profile</code> cannot:
|
||||
that flag detects merged identities, not split ones.`
|
||||
: `— just under the 0.85 line, on ${r.active_years} active
|
||||
year${r.active_years===1?'':'s'}. Thresholds are meant to surface the top of
|
||||
each bucket, and this profile sits one weight-tune away from either side.`}
|
||||
Either way it is the case coaches should see: ${d.total_coauthors} co-authors,
|
||||
brokerage ${fmt(r.brokerage,2)} (${pct(p.brokerage)} of the bucket),
|
||||
${pct(r.cross_institution_share)} cross-institution weight — a real profile that
|
||||
the ranking deliberately holds back.`;
|
||||
}
|
||||
|
||||
function svgNet(d) {
|
||||
const W = 760, H = 560, ns = 'http://www.w3.org/2000/svg';
|
||||
const svg = document.createElementNS(ns, 'svg');
|
||||
svg.setAttribute('viewBox', `0 0 ${W} ${H}`);
|
||||
svg.setAttribute('role', 'img');
|
||||
svg.setAttribute('aria-label', `Co-author network of ${d.score_row.display_name}`);
|
||||
const byId = {};
|
||||
d.nodes.forEach(n => byId[n.id] = n);
|
||||
const ego = d.nodes[0];
|
||||
const wmax = Math.max(...d.edges.map(e => e.w), 0.01);
|
||||
|
||||
const eg = document.createElementNS(ns, 'g');
|
||||
d.edges.forEach(e => {
|
||||
const a = byId[e.a], b = byId[e.b];
|
||||
if (!a || !b) return;
|
||||
const ln = document.createElementNS(ns, 'line');
|
||||
ln.setAttribute('x1', a.x); ln.setAttribute('y1', a.y);
|
||||
ln.setAttribute('x2', b.x); ln.setAttribute('y2', b.y);
|
||||
const touchesEgo = (e.a === ego.id || e.b === ego.id);
|
||||
ln.setAttribute('stroke', 'currentColor');
|
||||
ln.setAttribute('stroke-opacity', touchesEgo ? 0.42 : 0.16);
|
||||
ln.setAttribute('stroke-width', Math.max(0.6, Math.min(4.5, 2.8*Math.sqrt(e.w/wmax))));
|
||||
if (e.cross) ln.setAttribute('stroke-dasharray', '4 3');
|
||||
eg.appendChild(ln);
|
||||
});
|
||||
eg.setAttribute('color', 'var(--ink-3)');
|
||||
svg.appendChild(eg);
|
||||
|
||||
const edgeToEgo = {};
|
||||
d.edges.forEach(e => {
|
||||
if (e.a === ego.id) edgeToEgo[e.b] = e;
|
||||
if (e.b === ego.id) edgeToEgo[e.a] = e;
|
||||
});
|
||||
|
||||
const ng = document.createElementNS(ns, 'g');
|
||||
d.nodes.forEach(n => {
|
||||
const c = document.createElementNS(ns, 'circle');
|
||||
const isEgo = n.role === 'ego';
|
||||
const r = isEgo ? 13 : Math.max(4, Math.min(9, 3 + 1.1*Math.sqrt(n.active_years)));
|
||||
c.setAttribute('class', 'node');
|
||||
c.setAttribute('cx', n.x); c.setAttribute('cy', n.y); c.setAttribute('r', r);
|
||||
c.setAttribute('fill', `var(${ROLE[n.role]})`);
|
||||
c.setAttribute('stroke', isEgo ? 'var(--ink)' : 'var(--node-stroke)');
|
||||
c.setAttribute('stroke-width', isEgo ? 2.5 : 1);
|
||||
c.addEventListener('pointerenter', ev => {
|
||||
const e = edgeToEgo[n.id];
|
||||
showTip(ev, `
|
||||
<div class="t-name">${n.name || n.id}</div>
|
||||
<div>${ROLE_LABEL[n.role] || n.role}</div>
|
||||
${n.inst ? `<div class="t-dim">${n.inst}</div>` : ''}
|
||||
${n.company_insts ? `<div>Industry link: ${n.company_insts.join(', ')}</div>` : ''}
|
||||
<div class="t-dim">${n.active_years} active year${n.active_years===1?'':'s'}${
|
||||
e ? ` · tie strength ${e.w.toFixed(2)} · ${e.n} joint work${e.n===1?'':'s'} · since ${e.y0}` : ''}</div>`);
|
||||
});
|
||||
c.addEventListener('pointermove', moveTip);
|
||||
c.addEventListener('pointerleave', hideTip);
|
||||
ng.appendChild(c);
|
||||
});
|
||||
svg.appendChild(ng);
|
||||
|
||||
const label = document.createElementNS(ns, 'text');
|
||||
label.setAttribute('x', ego.x); label.setAttribute('y', ego.y + 30);
|
||||
label.setAttribute('text-anchor', 'middle');
|
||||
label.setAttribute('style', 'font-family:-apple-system,Segoe UI,sans-serif;font-size:12.5px;font-weight:700;fill:var(--ink);paint-order:stroke;stroke:var(--surface);stroke-width:3px;');
|
||||
label.textContent = ego.name;
|
||||
svg.appendChild(label);
|
||||
return svg;
|
||||
}
|
||||
|
||||
const tip = document.getElementById('tip');
|
||||
function showTip(ev, html) { tip.innerHTML = html; tip.style.display = 'block'; moveTip(ev); }
|
||||
function moveTip(ev) {
|
||||
const pad = 14;
|
||||
let x = ev.clientX + pad, y = ev.clientY + pad;
|
||||
const r = tip.getBoundingClientRect();
|
||||
if (x + r.width > innerWidth - 8) x = ev.clientX - r.width - pad;
|
||||
if (y + r.height > innerHeight - 8) y = ev.clientY - r.height - pad;
|
||||
tip.style.left = x + 'px'; tip.style.top = y + 'px';
|
||||
}
|
||||
function hideTip() { tip.style.display = 'none'; }
|
||||
|
||||
function metricRows(r) {
|
||||
const p = r.percentiles || {};
|
||||
const groups = [
|
||||
['Bridging', [
|
||||
['Betweenness', fmt(r.betweenness, r.betweenness && r.betweenness < 0.01 ? 4 : 3), p.betweenness],
|
||||
['Brokerage (1−constraint)', fmt(r.brokerage), p.brokerage],
|
||||
['Field entropy', fmt(r.field_entropy), p.field_entropy],
|
||||
['Cross-institution share', fmt(r.cross_institution_share), p.cross_institution_share],
|
||||
]],
|
||||
['Mentoring', [
|
||||
['Juniors mentored', r.juniors_mentored, p.juniors_mentored],
|
||||
['Last-author + junior first', r.last_author_with_junior_first, p.last_author_with_junior_first],
|
||||
['Mentoring rate', fmt(r.mentoring_rate), p.mentoring_rate],
|
||||
]],
|
||||
['Amplification', [
|
||||
['Industry share (shrunk)', fmt(r.industry_coauthor_share_shrunk), p.industry_coauthor_share_shrunk],
|
||||
['Patents (high-confidence)', r.patent_count, p.patent_count],
|
||||
['EU projects (DOI join)', r.cordis_eu_projects, p.cordis_eu_projects],
|
||||
['News mentions', r.news_mentions, p.news_mentions],
|
||||
]],
|
||||
];
|
||||
let html = '<table class="mx"><tr><th>Metric</th><th style="text-align:right">Raw</th><th style="text-align:right">Bucket pctl</th></tr>';
|
||||
for (const [g, rows] of groups) {
|
||||
html += `<tr><td colspan="3" style="border-top:none;padding-top:10px;font-weight:600;color:var(--ink-3);font-size:11px;letter-spacing:.06em;text-transform:uppercase">${g}</td></tr>`;
|
||||
for (const [nm, raw, pc] of rows) {
|
||||
const hot = pc != null && pc >= 0.9;
|
||||
html += `<tr><td>${nm}</td><td class="num">${raw == null ? '—' : raw}</td><td class="num${hot?' hot':''}">${pc==null?'—':pct(pc)}</td></tr>`;
|
||||
}
|
||||
}
|
||||
return html + '</table>';
|
||||
}
|
||||
|
||||
const container = document.getElementById('cases');
|
||||
let firstCase = null;
|
||||
for (const kind of ORDER) {
|
||||
const key = Object.keys(DATA).find(k => DATA[k].kind === kind);
|
||||
if (!key) continue;
|
||||
const d = DATA[key], r = d.score_row;
|
||||
if (!firstCase) firstCase = d;
|
||||
const [eyebrow, hue] = EYEBROW[kind];
|
||||
const lead = Object.entries(r.sub_scores).sort((a,b)=>b[1]-a[1])[0][0];
|
||||
|
||||
const sec = document.createElement('section');
|
||||
sec.className = 'case';
|
||||
sec.innerHTML = `
|
||||
<p class="case-eyebrow" style="color:var(${hue})">${eyebrow}</p>
|
||||
<div class="case-head">
|
||||
<h2>${r.display_name}</h2>
|
||||
${(r.tags||[]).map(t => `<span class="pill tag" style="background:var(${hue})">${t}</span>`).join('')}
|
||||
${(r.tags||[]).length === 0 ? '<span class="pill">no tag</span>' : ''}
|
||||
<span class="pill">${r.career_bucket} · ${r.active_years} active years</span>
|
||||
${r.suspicious_profile ? '<span class="pill">low-confidence profile</span>' : ''}
|
||||
</div>
|
||||
<p class="meta-line">${r.n_works} works · ${d.total_coauthors.toLocaleString('en')} co-authors
|
||||
(strongest ${d.shown} drawn) · author ${r.author_id}</p>
|
||||
<div class="case-grid">
|
||||
<div class="netbox">
|
||||
<div class="svg-slot"></div>
|
||||
<div class="netfoot">Edges among the drawn co-authors are the corpus's actual
|
||||
collaborations — their density (or absence) is what constraint/brokerage measures.</div>
|
||||
</div>
|
||||
<div class="panel">
|
||||
<div>
|
||||
<h3>Sub-scores <span style="letter-spacing:0;text-transform:none">(dashed line = 0.85 tag threshold)</span></h3>
|
||||
${['bridger','mentor','amplifier'].map(s => `
|
||||
<div class="scorebar">
|
||||
<span class="nm">${s}</span>
|
||||
<span class="track"><span class="fill${s===lead?' lead':''}" style="width:${(r.sub_scores[s]*100).toFixed(1)}%"></span><span class="thresh"></span></span>
|
||||
<span class="val">${fmt(r.sub_scores[s],3)}</span>
|
||||
</div>`).join('')}
|
||||
</div>
|
||||
<div>${metricRows(r)}</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="reading">${readingFor(kind, r, d)}</p>`;
|
||||
sec.querySelector('.svg-slot').appendChild(svgNet(d));
|
||||
container.appendChild(sec);
|
||||
}
|
||||
if (firstCase) {
|
||||
document.getElementById('cfg').textContent = firstCase.config_hash || '—';
|
||||
document.getElementById('ts').textContent = firstCase.computed_at || '—';
|
||||
}
|
||||
|
||||
document.getElementById('themeToggle').addEventListener('click', () => {
|
||||
const root = document.documentElement;
|
||||
const dark = root.getAttribute('data-theme') === 'dark' ||
|
||||
(!root.getAttribute('data-theme') && matchMedia('(prefers-color-scheme: dark)').matches);
|
||||
root.setAttribute('data-theme', dark ? 'light' : 'dark');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,7 +0,0 @@
|
||||
httpx>=0.27
|
||||
python-dotenv>=1.0
|
||||
polars>=1.0
|
||||
pyyaml>=6.0
|
||||
|
||||
# test-only (never in the service image):
|
||||
# pip install pytest networkx
|
||||
@@ -1,135 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
scoring.py — normalization, sub-scores and tags (M1, Stage F).
|
||||
|
||||
Procedure (per plan §3/§6):
|
||||
1. Bucket every focal author by career stage from `active_years`
|
||||
(Early/Emerging/Established/Senior — thresholds mirror inse/persons/logic.py).
|
||||
2. Percentile-rank every raw metric WITHIN its bucket, so early-career people
|
||||
compete against early-career people. The M0 spike found median active_years = 4:
|
||||
half the cohort is "Early", and institution-wide percentiles would simply rank
|
||||
seniority.
|
||||
3. Sub-scores = weighted mean of the percentiles (weights from multiplicators.yaml).
|
||||
4. Tag anyone >= tags.threshold on a sub-score (multiple tags allowed).
|
||||
|
||||
Raw values, percentiles, and sub-scores are ALL persisted — coaches and calibration
|
||||
both need the intermediates. None/NaN raw values are excluded from percentile ranking
|
||||
and contribute 0 to the weighted mean (weight is redistributed over present metrics).
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
from typing import Any
|
||||
|
||||
import yaml
|
||||
|
||||
|
||||
def load_config(path: str) -> dict[str, Any]:
|
||||
with open(path, "r", encoding="utf-8") as f:
|
||||
config = yaml.safe_load(f)
|
||||
config["_config_hash"] = hashlib.sha256(
|
||||
json.dumps(config, sort_keys=True, default=str).encode()
|
||||
).hexdigest()[:12]
|
||||
return config
|
||||
|
||||
|
||||
def career_bucket(active_years: int, thresholds: list[int], names: list[str]) -> str:
|
||||
"""Bucket by active_years. thresholds=[4,9,14] -> Early/Emerging/Established/Senior."""
|
||||
for threshold, name in zip(thresholds, names):
|
||||
if active_years <= threshold:
|
||||
return name
|
||||
return names[len(thresholds)]
|
||||
|
||||
|
||||
def percentile_ranks(values: dict[str, float | None]) -> dict[str, float]:
|
||||
"""Mean-rank percentiles in (0, 1] over the non-None values.
|
||||
|
||||
Ties share their mean rank, so a metric where most values are 0 (e.g.
|
||||
juniors_mentored for Early authors) does not hand everyone a high percentile.
|
||||
"""
|
||||
present = [(aid, v) for aid, v in values.items() if v is not None]
|
||||
if not present:
|
||||
return {}
|
||||
present.sort(key=lambda kv: kv[1])
|
||||
n = len(present)
|
||||
ranks: dict[str, float] = {}
|
||||
i = 0
|
||||
while i < n:
|
||||
j = i
|
||||
while j + 1 < n and present[j + 1][1] == present[i][1]:
|
||||
j += 1
|
||||
mean_rank = (i + j) / 2 + 1 # 1-based mean rank of the tie group
|
||||
for k in range(i, j + 1):
|
||||
ranks[present[k][0]] = mean_rank / n
|
||||
i = j + 1
|
||||
return ranks
|
||||
|
||||
|
||||
def score_rows(
|
||||
metric_rows: dict[str, dict[str, Any]], config: dict[str, Any]
|
||||
) -> list[dict[str, Any]]:
|
||||
"""Turn raw metric rows into scored, tagged, bucket-normalized output rows."""
|
||||
career_cfg = config["career"]
|
||||
weights: dict[str, dict[str, float]] = config["weights"]
|
||||
tag_threshold: float = config["tags"]["threshold"]
|
||||
min_active_years: int = config["tags"].get("min_active_years", 0)
|
||||
|
||||
# 1. bucket assignment
|
||||
buckets: dict[str, list[str]] = {}
|
||||
for aid, row in metric_rows.items():
|
||||
bucket = career_bucket(
|
||||
row["active_years"], career_cfg["buckets"], career_cfg["bucket_names"]
|
||||
)
|
||||
row["career_bucket"] = bucket
|
||||
buckets.setdefault(bucket, []).append(aid)
|
||||
|
||||
# 2. within-bucket percentiles for every metric used by any sub-score
|
||||
metric_names = sorted({m for w in weights.values() for m in w})
|
||||
percentiles: dict[str, dict[str, float]] = {aid: {} for aid in metric_rows}
|
||||
for bucket_members in buckets.values():
|
||||
for metric in metric_names:
|
||||
values = {
|
||||
aid: metric_rows[aid].get(metric)
|
||||
for aid in bucket_members
|
||||
if isinstance(metric_rows[aid].get(metric), (int, float))
|
||||
}
|
||||
for aid, pctl in percentile_ranks(values).items():
|
||||
percentiles[aid][metric] = pctl
|
||||
|
||||
# 3+4. weighted sub-scores and tags
|
||||
out: list[dict[str, Any]] = []
|
||||
for aid, row in metric_rows.items():
|
||||
sub_scores: dict[str, float] = {}
|
||||
for sub, metric_weights in weights.items():
|
||||
total_weight = 0.0
|
||||
acc = 0.0
|
||||
for metric, weight in metric_weights.items():
|
||||
pctl = percentiles[aid].get(metric)
|
||||
if pctl is not None:
|
||||
acc += weight * pctl
|
||||
total_weight += weight
|
||||
sub_scores[sub] = round(acc / total_weight, 4) if total_weight > 0 else 0.0
|
||||
|
||||
tags = (
|
||||
[s for s, v in sub_scores.items() if v >= tag_threshold]
|
||||
if row["active_years"] >= min_active_years
|
||||
else []
|
||||
)
|
||||
|
||||
out.append(
|
||||
{
|
||||
**{k: v for k, v in row.items() if k != "junior_ids"},
|
||||
"percentiles": {
|
||||
m: round(p, 4) for m, p in percentiles[aid].items()
|
||||
},
|
||||
"sub_scores": sub_scores,
|
||||
"tags": tags,
|
||||
"max_sub_score": max(sub_scores.values()) if sub_scores else 0.0,
|
||||
"evidence": {"junior_ids": row.get("junior_ids", [])[:25]},
|
||||
"config_hash": config["_config_hash"],
|
||||
}
|
||||
)
|
||||
|
||||
out.sort(key=lambda r: r["max_sub_score"], reverse=True)
|
||||
return out
|
||||
@@ -1,232 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
signals.py — M3 amplifier signal joins: patents, news, EU CORDIS projects.
|
||||
|
||||
Link quality differs per source and dictates how each is used (plan §4):
|
||||
|
||||
PATENTS org_patents.matched_authors carries real OpenAlex author IDs with a
|
||||
doc-level match_type. Only {institution, both} count toward the score;
|
||||
name-only matches are kept as a separate evidence count.
|
||||
NEWS aktuell_postproc holds LLM-extracted person names. Matching is
|
||||
normalized-exact (casefold + diacritic fold): "René Müller" == "rene
|
||||
muller". A normalized name shared by MULTIPLE cohort authors is skipped
|
||||
entirely (precision over recall) — crediting the wrong person is worse
|
||||
than missing a mention. Low YAML weight by design.
|
||||
CORDIS DOI-overlap join (no name matching): the author's work DOIs from the
|
||||
extract intersected with cordis_eu_*_publications DOIs -> distinct
|
||||
project IDs per author.
|
||||
|
||||
All functions return plain dict[author_short_id, count] and are independent of the
|
||||
graph/scoring modules.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import unicodedata
|
||||
from collections import defaultdict
|
||||
from typing import Any
|
||||
|
||||
import httpx
|
||||
|
||||
from extract import INSE_KEY, INSE_URL, es_search
|
||||
|
||||
PAGE_SIZE = 1000
|
||||
DOI_BATCH = 500
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Patents — org_patents (already author-ID-linked by index_org_patents.py)
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def patent_counts(
|
||||
client: httpx.Client,
|
||||
institution_short_id: str,
|
||||
scored_match_types: tuple[str, ...] = ("institution", "both"),
|
||||
) -> tuple[dict[str, int], dict[str, int]]:
|
||||
"""Per-author patent counts from org_patents.
|
||||
|
||||
Returns (scored, name_only): scored counts only docs whose match_type is in
|
||||
`scored_match_types`; name_only is kept as evidence and never enters the score.
|
||||
"""
|
||||
scored: dict[str, int] = defaultdict(int)
|
||||
name_only: dict[str, int] = defaultdict(int)
|
||||
search_after = None
|
||||
while True:
|
||||
body: dict[str, Any] = {
|
||||
"size": PAGE_SIZE,
|
||||
"_source": ["match_type", "matched_authors.openalex_author_id"],
|
||||
"query": {"term": {"institution_id": institution_short_id}},
|
||||
"sort": [{"patent_id": {"order": "asc"}}],
|
||||
}
|
||||
if search_after:
|
||||
body["search_after"] = search_after
|
||||
result = es_search(client, INSE_URL, INSE_KEY, "org_patents", body)
|
||||
hits = result["hits"]["hits"]
|
||||
if not hits:
|
||||
break
|
||||
for hit in hits:
|
||||
src = hit["_source"]
|
||||
target = scored if src.get("match_type") in scored_match_types else name_only
|
||||
for author in src.get("matched_authors") or []:
|
||||
aid = author.get("openalex_author_id")
|
||||
if aid:
|
||||
target[aid] += 1
|
||||
search_after = hits[-1]["sort"]
|
||||
return dict(scored), dict(name_only)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# News — aktuell_postproc (LLM-extracted names, normalized-exact match)
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def normalize_name(name: str) -> str:
|
||||
"""casefold + strip diacritics + collapse whitespace ("René Müller" -> "rene muller")."""
|
||||
decomposed = unicodedata.normalize("NFKD", name)
|
||||
stripped = "".join(c for c in decomposed if not unicodedata.combining(c))
|
||||
return " ".join(stripped.casefold().split())
|
||||
|
||||
|
||||
def news_mention_counts(
|
||||
client: httpx.Client,
|
||||
display_names: dict[str, str],
|
||||
require_relevant: bool = True,
|
||||
) -> tuple[dict[str, int], int]:
|
||||
"""Per-author news mention counts.
|
||||
|
||||
display_names: author_short_id -> display_name for the whole cohort.
|
||||
Returns (counts, ambiguous_names_skipped). Names that normalize identically for
|
||||
more than one cohort author are skipped entirely.
|
||||
"""
|
||||
by_norm: dict[str, list[str]] = defaultdict(list)
|
||||
for aid, name in display_names.items():
|
||||
if name:
|
||||
by_norm[normalize_name(name)].append(aid)
|
||||
ambiguous = {norm for norm, aids in by_norm.items() if len(aids) > 1}
|
||||
|
||||
counts: dict[str, int] = defaultdict(int)
|
||||
search_after = None
|
||||
while True:
|
||||
body: dict[str, Any] = {
|
||||
"size": PAGE_SIZE,
|
||||
"_source": ["authors", "relevant"],
|
||||
"query": {"exists": {"field": "authors"}},
|
||||
"sort": [{"news_id.keyword": {"order": "asc"}}],
|
||||
}
|
||||
if search_after:
|
||||
body["search_after"] = search_after
|
||||
result = es_search(client, INSE_URL, INSE_KEY, "aktuell_postproc", body)
|
||||
hits = result["hits"]["hits"]
|
||||
if not hits:
|
||||
break
|
||||
for hit in hits:
|
||||
src = hit["_source"]
|
||||
if require_relevant and not src.get("relevant"):
|
||||
continue
|
||||
for name in src.get("authors") or []:
|
||||
norm = normalize_name(name)
|
||||
if norm in ambiguous:
|
||||
continue
|
||||
aids = by_norm.get(norm)
|
||||
if aids:
|
||||
counts[aids[0]] += 1
|
||||
search_after = hits[-1]["sort"]
|
||||
return dict(counts), len(ambiguous)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# EU CORDIS — DOI-overlap join
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def normalize_doi(doi: str | None) -> str | None:
|
||||
if not doi:
|
||||
return None
|
||||
doi = doi.strip().casefold()
|
||||
for prefix in ("https://doi.org/", "http://doi.org/", "doi.org/", "doi:"):
|
||||
if doi.startswith(prefix):
|
||||
doi = doi[len(prefix):]
|
||||
return doi or None
|
||||
|
||||
|
||||
def cordis_project_counts(
|
||||
client: httpx.Client,
|
||||
dois_by_author: dict[str, set[str]],
|
||||
) -> dict[str, int]:
|
||||
"""Distinct CORDIS project count per author via DOI overlap.
|
||||
|
||||
dois_by_author values must already be normalized (normalize_doi).
|
||||
"""
|
||||
all_dois = sorted({d for dois in dois_by_author.values() for d in dois})
|
||||
projects_by_doi: dict[str, set[str]] = defaultdict(set)
|
||||
|
||||
for start in range(0, len(all_dois), DOI_BATCH):
|
||||
batch = all_dois[start : start + DOI_BATCH]
|
||||
# NOT a terms query: 21% of CORDIS DOIs contain uppercase, and `terms` on a
|
||||
# keyword field is case-sensitive. Per-term case_insensitive matching instead.
|
||||
result = es_search(
|
||||
client, INSE_URL, INSE_KEY, "cordis_eu_*_publications",
|
||||
{
|
||||
"size": len(batch) * 4, # a DOI can appear in several frameworks
|
||||
"_source": ["doi", "projectID"],
|
||||
"query": {
|
||||
"bool": {
|
||||
"should": [
|
||||
{"term": {"doi": {"value": d, "case_insensitive": True}}}
|
||||
for d in batch
|
||||
],
|
||||
"minimum_should_match": 1,
|
||||
}
|
||||
},
|
||||
},
|
||||
)
|
||||
for hit in result["hits"]["hits"]:
|
||||
src = hit["_source"]
|
||||
doi = normalize_doi(src.get("doi"))
|
||||
project = src.get("projectID")
|
||||
if doi and project is not None:
|
||||
projects_by_doi[doi].add(str(project))
|
||||
|
||||
counts: dict[str, int] = {}
|
||||
for aid, dois in dois_by_author.items():
|
||||
projects: set[str] = set()
|
||||
for doi in dois:
|
||||
projects |= projects_by_doi.get(doi, set())
|
||||
if projects:
|
||||
counts[aid] = len(projects)
|
||||
return counts
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Orchestration
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def collect_signals(
|
||||
institution_short_id: str,
|
||||
display_names: dict[str, str],
|
||||
dois_by_author: dict[str, set[str]],
|
||||
scored_match_types: tuple[str, ...] = ("institution", "both"),
|
||||
news_require_relevant: bool = True,
|
||||
) -> dict[str, dict[str, int]]:
|
||||
"""All signal joins. Returns per-metric dicts keyed by author_short_id."""
|
||||
with httpx.Client() as client:
|
||||
patents_scored, patents_name_only = patent_counts(
|
||||
client, institution_short_id, scored_match_types
|
||||
)
|
||||
news, ambiguous_skipped = news_mention_counts(
|
||||
client, display_names, require_relevant=news_require_relevant
|
||||
)
|
||||
cordis = cordis_project_counts(client, dois_by_author)
|
||||
print(
|
||||
f"Signals: patents scored for {len(patents_scored)} authors "
|
||||
f"(name-only evidence: {len(patents_name_only)}), "
|
||||
f"news mentions for {len(news)} (ambiguous names skipped: {ambiguous_skipped}), "
|
||||
f"CORDIS projects for {len(cordis)}"
|
||||
)
|
||||
return {
|
||||
"patent_count": patents_scored,
|
||||
"patent_count_name_only": patents_name_only,
|
||||
"news_mentions": news,
|
||||
"cordis_eu_projects": cordis,
|
||||
}
|
||||
@@ -1,656 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
spike_audit.py — M0 de-risking spike for the multiplicator-detection module.
|
||||
|
||||
Extracts the institution's OpenAlex author set (two-group union) and the FULL-authorship
|
||||
work set for those authors, caches both as gzipped JSONL, and prints an audit report that
|
||||
answers the six questions the rest of the pipeline is betting on:
|
||||
|
||||
1. Reproduction — author / work counts vs the known 4,921 / 183,661 for UDE.
|
||||
2. Field coverage — % of authorships with author_position / is_corresponding, and
|
||||
% of institutions with a non-null `type`. Decides whether the
|
||||
mentorship (last-author) and cross-sector signals are computable.
|
||||
3. Scale — authors-per-work histogram and distinct co-author pair counts at
|
||||
caps of 20 / 50 / 100. Picks max_authors_per_work; confirms the
|
||||
"pure Python / polars, no DuckDB" sizing bet.
|
||||
4. Quality — % of authors flagged has_suspicious_publication_years (merged
|
||||
profiles) and the active_years distribution.
|
||||
5. Permissions — can we create / bulk-write / delete on the INSE cluster, and does
|
||||
_delete_by_query 403 there as it does for org_patents?
|
||||
6. Signals — does org_patents carry matched_authors for this institution, and
|
||||
what is the match_type breakdown?
|
||||
|
||||
Unlike the seed (llm_evaluations/.../build_ude_author_work_set.py) this drops inner_hits
|
||||
and pulls every authorship (external co-authors + their institutions) — without that
|
||||
there is no bridging signal.
|
||||
|
||||
Usage:
|
||||
python service/scripts/multipliers/spike_audit.py --institution-id I62318514
|
||||
|
||||
Credentials are read from service/src/main/inse/.env (ELASTICSEARCH_* for the NES/OpenAlex
|
||||
cluster, ELASTICSEARCH_INSE_* for patents/news). Nothing is written to the real cluster
|
||||
unless --probe-writes is passed (it creates and deletes a throwaway index).
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import collections
|
||||
import gzip
|
||||
import json
|
||||
import math
|
||||
import os
|
||||
import statistics
|
||||
import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
from typing import Any, Iterable, Iterator
|
||||
|
||||
import httpx
|
||||
import yaml
|
||||
from dotenv import load_dotenv
|
||||
|
||||
SCRIPT_DIR = Path(__file__).resolve().parent
|
||||
ENV_PATH = SCRIPT_DIR.parent.parent / "src" / "main" / "inse" / ".env"
|
||||
load_dotenv(dotenv_path=ENV_PATH)
|
||||
|
||||
# --- clusters -------------------------------------------------------------
|
||||
|
||||
NES_URL = (os.environ.get("ELASTICSEARCH_URL") or "").rstrip("/")
|
||||
NES_KEY = os.environ.get("ELASTICSEARCH_API_KEY") or ""
|
||||
INSE_URL = (os.environ.get("ELASTICSEARCH_INSE_URL") or "").rstrip("/")
|
||||
INSE_KEY = os.environ.get("ELASTICSEARCH_INSE_API_KEY") or ""
|
||||
|
||||
# --- extraction knobs (spike-only; the real build reads these from YAML) --
|
||||
|
||||
AFFILIATION_YEAR_GTE = 2025
|
||||
WORK_YEAR_GTE = 1950
|
||||
AUTHOR_PAGE_SIZE = 1000
|
||||
AUTHOR_BATCH_SIZE = 250
|
||||
WORK_PAGE_SIZE = 1000
|
||||
PAIR_CAPS = (20, 50, 100)
|
||||
REQUEST_TIMEOUT = 180.0
|
||||
PROBE_INDEX = "multiplicators_spike_probe"
|
||||
|
||||
|
||||
# ES helpers
|
||||
|
||||
|
||||
def _headers(api_key: str) -> dict[str, str]:
|
||||
return {
|
||||
"Authorization": f"ApiKey {api_key}",
|
||||
"Content-Type": "application/json",
|
||||
"Accept": "application/json",
|
||||
}
|
||||
|
||||
|
||||
def es_request(
|
||||
client: httpx.Client,
|
||||
method: str,
|
||||
base_url: str,
|
||||
api_key: str,
|
||||
path: str,
|
||||
body: dict[str, Any] | None = None,
|
||||
) -> httpx.Response:
|
||||
url = f"{base_url}/{path.lstrip('/')}"
|
||||
return client.request(
|
||||
method, url, headers=_headers(api_key), json=body, timeout=REQUEST_TIMEOUT
|
||||
)
|
||||
|
||||
|
||||
def es_search(
|
||||
client: httpx.Client, base_url: str, api_key: str, index: str, body: dict[str, Any]
|
||||
) -> dict[str, Any]:
|
||||
response = es_request(client, "POST", base_url, api_key, f"{index}/_search", body)
|
||||
if not response.is_success:
|
||||
raise RuntimeError(
|
||||
f"ES error {response.status_code} for {index}:\n{response.text[:1000]}"
|
||||
)
|
||||
return response.json()
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Institution resolution (parameterised — no hardcoded UDE)
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def resolve_institution(client: httpx.Client, institution_id: str) -> dict[str, Any]:
|
||||
"""Look up ror + display_name for --institution-id from openalex-institutions."""
|
||||
raw = institution_id.strip()
|
||||
short = raw.rsplit("/", 1)[-1]
|
||||
full = f"https://openalex.org/{short}"
|
||||
|
||||
result = es_search(
|
||||
client,
|
||||
NES_URL,
|
||||
NES_KEY,
|
||||
"openalex-institutions",
|
||||
{"size": 1, "query": {"term": {"id": full}}},
|
||||
)
|
||||
hits = result["hits"]["hits"]
|
||||
if not hits:
|
||||
raise SystemExit(f"Institution {full} not found in openalex-institutions.")
|
||||
|
||||
source = hits[0]["_source"]
|
||||
return {
|
||||
"id": full,
|
||||
"short_id": short,
|
||||
"ror": source.get("ror"),
|
||||
"display_name": source.get("display_name"),
|
||||
}
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Author queries (two-group union — group 2 recovers empty-last-known authors)
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def recent_affiliation_filter(insts: list[dict[str, Any]]) -> dict[str, Any]:
|
||||
"""Recent affiliation with ANY cohort institution (matched by id, ror as backup)."""
|
||||
ids = [i["id"] for i in insts]
|
||||
shoulds: list[dict[str, Any]] = [{"terms": {"affiliations.institution.id": ids}}]
|
||||
rors = [i["ror"] for i in insts if i.get("ror")]
|
||||
if rors:
|
||||
shoulds.append({"terms": {"affiliations.institution.ror": rors}})
|
||||
return {
|
||||
"nested": {
|
||||
"path": "affiliations",
|
||||
"query": {
|
||||
"bool": {
|
||||
"filter": [
|
||||
{"bool": {"should": shoulds, "minimum_should_match": 1}},
|
||||
{"range": {"affiliations.years": {"gte": AFFILIATION_YEAR_GTE}}},
|
||||
]
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def last_known_filter(insts: list[dict[str, Any]]) -> dict[str, Any]:
|
||||
"""last_known_institutions membership in the cohort, matched by ID.
|
||||
|
||||
(The seed script matched the display_name string; ID terms are equivalent for a
|
||||
single institution and the only sane option for a multi-institution cohort.)"""
|
||||
return {
|
||||
"nested": {
|
||||
"path": "last_known_institutions",
|
||||
"query": {
|
||||
"terms": {"last_known_institutions.id": [i["id"] for i in insts]}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def last_known_exists_filter() -> dict[str, Any]:
|
||||
return {
|
||||
"nested": {
|
||||
"path": "last_known_institutions",
|
||||
"query": {"exists": {"field": "last_known_institutions.display_name"}},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
AUTHOR_SOURCE = [
|
||||
"id",
|
||||
"display_name",
|
||||
"orcid",
|
||||
"works_count",
|
||||
"cited_by_count",
|
||||
"last_known_institutions",
|
||||
"affiliations",
|
||||
]
|
||||
|
||||
|
||||
def author_query(query: dict[str, Any], search_after: Any) -> dict[str, Any]:
|
||||
body = {
|
||||
"size": AUTHOR_PAGE_SIZE,
|
||||
"track_total_hits": True,
|
||||
"_source": AUTHOR_SOURCE,
|
||||
"query": query,
|
||||
"sort": [{"id": {"order": "asc"}}],
|
||||
}
|
||||
if search_after:
|
||||
body["search_after"] = search_after
|
||||
return body
|
||||
|
||||
|
||||
def collect_authors(
|
||||
client: httpx.Client, insts: list[dict[str, Any]]
|
||||
) -> dict[str, dict[str, Any]]:
|
||||
groups = {
|
||||
"backend_compatible": {
|
||||
"bool": {
|
||||
"filter": [last_known_filter(insts), recent_affiliation_filter(insts)]
|
||||
}
|
||||
},
|
||||
"empty_last_known_recent": {
|
||||
"bool": {
|
||||
"filter": [recent_affiliation_filter(insts)],
|
||||
"must_not": [last_known_exists_filter()],
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
authors: dict[str, dict[str, Any]] = {}
|
||||
for group_name, query in groups.items():
|
||||
search_after = None
|
||||
total = None
|
||||
read = 0
|
||||
while True:
|
||||
result = es_search(
|
||||
client, NES_URL, NES_KEY, "openalex-authors",
|
||||
author_query(query, search_after),
|
||||
)
|
||||
hits = result["hits"]["hits"]
|
||||
if total is None:
|
||||
total = result["hits"]["total"]["value"]
|
||||
print(f" [{group_name}] expected {total}")
|
||||
if not hits:
|
||||
break
|
||||
for hit in hits:
|
||||
src = hit["_source"]
|
||||
aid = src.get("id")
|
||||
if not aid:
|
||||
continue
|
||||
if aid not in authors:
|
||||
authors[aid] = {
|
||||
"id": aid,
|
||||
"display_name": src.get("display_name"),
|
||||
"orcid": src.get("orcid"),
|
||||
"works_count": src.get("works_count"),
|
||||
"cited_by_count": src.get("cited_by_count"),
|
||||
"source_sets": [group_name],
|
||||
}
|
||||
elif group_name not in authors[aid]["source_sets"]:
|
||||
authors[aid]["source_sets"].append(group_name)
|
||||
read += 1
|
||||
search_after = hits[-1]["sort"]
|
||||
print(f" [{group_name}] read {read}/{total}")
|
||||
time.sleep(0.05)
|
||||
return authors
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Work queries — FULL authorships, no inner_hits
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
WORK_SOURCE = [
|
||||
"id",
|
||||
"doi",
|
||||
"publication_year",
|
||||
"type",
|
||||
"cited_by_count",
|
||||
"primary_topic.id",
|
||||
"primary_topic.display_name",
|
||||
"primary_topic.field.id",
|
||||
"primary_topic.field.display_name",
|
||||
"authorships.author.id",
|
||||
"authorships.author.display_name",
|
||||
"authorships.author_position",
|
||||
"authorships.is_corresponding",
|
||||
"authorships.institutions.id",
|
||||
"authorships.institutions.display_name",
|
||||
"authorships.institutions.type",
|
||||
"authorships.institutions.country_code",
|
||||
"authorships.institutions.lineage",
|
||||
]
|
||||
|
||||
|
||||
def works_batch_query(author_ids: list[str], search_after: Any) -> dict[str, Any]:
|
||||
body = {
|
||||
"size": WORK_PAGE_SIZE,
|
||||
"track_total_hits": True,
|
||||
"_source": WORK_SOURCE,
|
||||
"query": {
|
||||
"bool": {
|
||||
"filter": [
|
||||
{"range": {"publication_year": {"gte": WORK_YEAR_GTE}}},
|
||||
{
|
||||
"nested": {
|
||||
"path": "authorships",
|
||||
"query": {"terms": {"authorships.author.id": author_ids}},
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
"sort": [{"id": {"order": "asc"}}],
|
||||
}
|
||||
if search_after:
|
||||
body["search_after"] = search_after
|
||||
return body
|
||||
|
||||
|
||||
def collect_works(
|
||||
client: httpx.Client, author_ids: list[str]
|
||||
) -> dict[str, dict[str, Any]]:
|
||||
works: dict[str, dict[str, Any]] = {}
|
||||
total_batches = (len(author_ids) + AUTHOR_BATCH_SIZE - 1) // AUTHOR_BATCH_SIZE
|
||||
for i in range(0, len(author_ids), AUTHOR_BATCH_SIZE):
|
||||
batch = author_ids[i : i + AUTHOR_BATCH_SIZE]
|
||||
batch_no = i // AUTHOR_BATCH_SIZE + 1
|
||||
search_after = None
|
||||
while True:
|
||||
result = es_search(
|
||||
client, NES_URL, NES_KEY, "openalex-works*",
|
||||
works_batch_query(batch, search_after),
|
||||
)
|
||||
hits = result["hits"]["hits"]
|
||||
if not hits:
|
||||
break
|
||||
for hit in hits:
|
||||
src = hit["_source"]
|
||||
wid = src.get("id")
|
||||
if wid and wid not in works:
|
||||
works[wid] = src
|
||||
search_after = hits[-1]["sort"]
|
||||
print(f" work batch {batch_no}/{total_batches}: unique works {len(works)}")
|
||||
time.sleep(0.05)
|
||||
return works
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Cache IO
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def write_jsonl_gz(path: Path, records: Iterable[dict[str, Any]]) -> None:
|
||||
with gzip.open(path, "wt", encoding="utf-8", newline="\n") as f:
|
||||
for record in records:
|
||||
f.write(json.dumps(record, ensure_ascii=True) + "\n")
|
||||
|
||||
|
||||
def read_jsonl_gz(path: Path) -> Iterator[dict[str, Any]]:
|
||||
with gzip.open(path, "rt", encoding="utf-8") as f:
|
||||
for line in f:
|
||||
line = line.strip()
|
||||
if line:
|
||||
yield json.loads(line)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Audit computations
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def _percentile(sorted_vals: list[int], q: float) -> int:
|
||||
if not sorted_vals:
|
||||
return 0
|
||||
idx = min(len(sorted_vals) - 1, int(math.ceil(q * len(sorted_vals)) - 1))
|
||||
return sorted_vals[max(0, idx)]
|
||||
|
||||
|
||||
def audit_field_coverage(works: list[dict[str, Any]]) -> dict[str, Any]:
|
||||
n_authorships = 0
|
||||
with_position = 0
|
||||
with_corresponding = 0
|
||||
n_institutions = 0
|
||||
with_inst_type = 0
|
||||
company_institutions = 0
|
||||
|
||||
for w in works:
|
||||
for a in w.get("authorships", []) or []:
|
||||
n_authorships += 1
|
||||
if a.get("author_position"):
|
||||
with_position += 1
|
||||
if a.get("is_corresponding") is not None:
|
||||
with_corresponding += 1
|
||||
for inst in a.get("institutions", []) or []:
|
||||
n_institutions += 1
|
||||
itype = inst.get("type")
|
||||
if itype:
|
||||
with_inst_type += 1
|
||||
if itype == "company":
|
||||
company_institutions += 1
|
||||
|
||||
def pct(x: int, n: int) -> float:
|
||||
return round(100.0 * x / n, 2) if n else 0.0
|
||||
|
||||
return {
|
||||
"authorships_total": n_authorships,
|
||||
"author_position_pct": pct(with_position, n_authorships),
|
||||
"is_corresponding_pct": pct(with_corresponding, n_authorships),
|
||||
"institutions_total": n_institutions,
|
||||
"institution_type_pct": pct(with_inst_type, n_institutions),
|
||||
"company_institutions": company_institutions,
|
||||
}
|
||||
|
||||
|
||||
def audit_scale(works: list[dict[str, Any]]) -> dict[str, Any]:
|
||||
sizes: list[int] = []
|
||||
pairs_at_cap = {cap: 0 for cap in PAIR_CAPS}
|
||||
for w in works:
|
||||
author_ids = {
|
||||
a["author"]["id"]
|
||||
for a in (w.get("authorships") or [])
|
||||
if a.get("author", {}).get("id")
|
||||
}
|
||||
n = len(author_ids)
|
||||
sizes.append(n)
|
||||
for cap in PAIR_CAPS:
|
||||
if 2 <= n <= cap:
|
||||
pairs_at_cap[cap] += n * (n - 1) // 2
|
||||
sizes_sorted = sorted(sizes)
|
||||
return {
|
||||
"works": len(sizes),
|
||||
"authors_per_work": {
|
||||
"p50": _percentile(sizes_sorted, 0.50),
|
||||
"p90": _percentile(sizes_sorted, 0.90),
|
||||
"p99": _percentile(sizes_sorted, 0.99),
|
||||
"max": sizes_sorted[-1] if sizes_sorted else 0,
|
||||
},
|
||||
"hyperauthorship_works_gt_100": sum(1 for s in sizes if s > 100),
|
||||
"pair_instances_at_cap": pairs_at_cap,
|
||||
}
|
||||
|
||||
|
||||
def audit_career(
|
||||
author_ids: set[str], works: list[dict[str, Any]]
|
||||
) -> dict[str, Any]:
|
||||
"""active_years and suspicious-profile flags for in-set authors (exact history)."""
|
||||
years_by_author: dict[str, set[int]] = collections.defaultdict(set)
|
||||
for w in works:
|
||||
year = w.get("publication_year")
|
||||
if not isinstance(year, int):
|
||||
continue
|
||||
for a in w.get("authorships", []) or []:
|
||||
aid = a.get("author", {}).get("id")
|
||||
if aid in author_ids:
|
||||
years_by_author[aid].add(year)
|
||||
|
||||
active_years_list: list[int] = []
|
||||
suspicious = 0
|
||||
for aid in author_ids:
|
||||
years = years_by_author.get(aid)
|
||||
if not years:
|
||||
continue
|
||||
active_years_list.append(len(years))
|
||||
first_year = min(years)
|
||||
span = max(years) - first_year + 1
|
||||
if first_year < 1970 or span > 60:
|
||||
suspicious += 1
|
||||
|
||||
ay_sorted = sorted(active_years_list)
|
||||
return {
|
||||
"authors_with_works": len(ay_sorted),
|
||||
"suspicious_profile_count": suspicious,
|
||||
"suspicious_profile_pct": (
|
||||
round(100.0 * suspicious / len(ay_sorted), 2) if ay_sorted else 0.0
|
||||
),
|
||||
"active_years": {
|
||||
"p50": _percentile(ay_sorted, 0.50),
|
||||
"p90": _percentile(ay_sorted, 0.90),
|
||||
"max": ay_sorted[-1] if ay_sorted else 0,
|
||||
"mean": round(statistics.fmean(ay_sorted), 2) if ay_sorted else 0.0,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def audit_signals(client: httpx.Client, inst: dict[str, Any]) -> dict[str, Any]:
|
||||
"""Probe org_patents (INSE cluster) for matched_authors + match_type breakdown."""
|
||||
if not INSE_URL or not INSE_KEY:
|
||||
return {"error": "INSE cluster credentials missing"}
|
||||
try:
|
||||
result = es_search(
|
||||
client, INSE_URL, INSE_KEY, "org_patents",
|
||||
{
|
||||
"size": 0,
|
||||
"track_total_hits": True,
|
||||
"query": {"term": {"institution_id": inst["short_id"]}},
|
||||
"aggs": {"by_match_type": {"terms": {"field": "match_type"}}},
|
||||
},
|
||||
)
|
||||
except RuntimeError as exc:
|
||||
return {"error": str(exc)[:300]}
|
||||
buckets = (
|
||||
result.get("aggregations", {}).get("by_match_type", {}).get("buckets", [])
|
||||
)
|
||||
return {
|
||||
"org_patents_for_institution": result["hits"]["total"]["value"],
|
||||
"match_type_breakdown": {b["key"]: b["doc_count"] for b in buckets},
|
||||
}
|
||||
|
||||
|
||||
def audit_permissions(client: httpx.Client, probe_writes: bool) -> dict[str, Any]:
|
||||
"""Test create / bulk / delete-by-query / delete on the INSE cluster."""
|
||||
if not probe_writes:
|
||||
return {"skipped": "pass --probe-writes to test index create/bulk/delete"}
|
||||
if not INSE_URL or not INSE_KEY:
|
||||
return {"error": "INSE cluster credentials missing"}
|
||||
|
||||
out: dict[str, Any] = {}
|
||||
create = es_request(
|
||||
client, "PUT", INSE_URL, INSE_KEY, PROBE_INDEX,
|
||||
{"mappings": {"properties": {"institution_id": {"type": "keyword"}}}},
|
||||
)
|
||||
out["create_index"] = create.status_code
|
||||
if create.is_success:
|
||||
bulk_body = (
|
||||
json.dumps({"index": {"_index": PROBE_INDEX, "_id": "probe_1"}})
|
||||
+ "\n"
|
||||
+ json.dumps({"institution_id": "PROBE"})
|
||||
+ "\n"
|
||||
)
|
||||
bulk = client.post(
|
||||
f"{INSE_URL}/_bulk",
|
||||
headers={**_headers(INSE_KEY), "Content-Type": "application/x-ndjson"},
|
||||
content=bulk_body,
|
||||
timeout=REQUEST_TIMEOUT,
|
||||
)
|
||||
out["bulk_index"] = bulk.status_code
|
||||
client.post(f"{INSE_URL}/{PROBE_INDEX}/_refresh", headers=_headers(INSE_KEY))
|
||||
dbq = es_request(
|
||||
client, "POST", INSE_URL, INSE_KEY, f"{PROBE_INDEX}/_delete_by_query",
|
||||
{"query": {"term": {"institution_id": "PROBE"}}},
|
||||
)
|
||||
out["delete_by_query"] = dbq.status_code # expect 403 if it mirrors org_patents
|
||||
drop = es_request(client, "DELETE", INSE_URL, INSE_KEY, PROBE_INDEX)
|
||||
out["delete_index"] = drop.status_code
|
||||
return out
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Main
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--institution-id", required=True)
|
||||
parser.add_argument(
|
||||
"--config", default=str(SCRIPT_DIR / "multipliers.yaml"),
|
||||
help="YAML config; its cohorts.<ID>.institution_ids extends the author set "
|
||||
"beyond the primary institution (e.g. the university hospital).",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--cache-dir", default=str(SCRIPT_DIR / "cache"),
|
||||
help="Where to read/write the extracted author/work JSONL.gz",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--skip-extract", action="store_true",
|
||||
help="Reuse cached JSONL.gz instead of hitting ES for author/work extraction.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--probe-writes", action="store_true",
|
||||
help="Create+bulk+delete a throwaway index on INSE to test write permissions.",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
if not NES_URL or not NES_KEY:
|
||||
raise SystemExit(f"Missing NES credentials. Checked {ENV_PATH}")
|
||||
|
||||
cache_dir = Path(args.cache_dir)
|
||||
cache_dir.mkdir(parents=True, exist_ok=True)
|
||||
short = args.institution_id.strip().rsplit("/", 1)[-1]
|
||||
authors_path = cache_dir / f"authors_{short}.jsonl.gz"
|
||||
works_path = cache_dir / f"works_{short}.jsonl.gz"
|
||||
|
||||
cohort_ids = [short]
|
||||
config_path = Path(args.config)
|
||||
if config_path.exists():
|
||||
with open(config_path, "r", encoding="utf-8") as f:
|
||||
cfg = yaml.safe_load(f) or {}
|
||||
cohort_cfg = (cfg.get("cohorts") or {}).get(short) or {}
|
||||
if cohort_cfg.get("institution_ids"):
|
||||
cohort_ids = [str(i) for i in cohort_cfg["institution_ids"]]
|
||||
|
||||
with httpx.Client() as client:
|
||||
insts = [resolve_institution(client, i) for i in cohort_ids]
|
||||
inst = insts[0] # primary
|
||||
print(f"Cohort ({len(insts)} institutions):")
|
||||
for i in insts:
|
||||
print(f" {i['short_id']:<14} {i['display_name']}")
|
||||
|
||||
if args.skip_extract and authors_path.exists() and works_path.exists():
|
||||
print("Reusing cached extract.")
|
||||
authors = {a["id"]: a for a in read_jsonl_gz(authors_path)}
|
||||
works = list(read_jsonl_gz(works_path))
|
||||
else:
|
||||
print("\nExtracting authors...")
|
||||
authors = collect_authors(client, insts)
|
||||
write_jsonl_gz(authors_path, authors.values())
|
||||
print(f"Authors: {len(authors)} -> {authors_path}")
|
||||
|
||||
print("\nExtracting works (full authorships)...")
|
||||
author_ids = sorted(authors.keys())
|
||||
works_map = collect_works(client, author_ids)
|
||||
works = list(works_map.values())
|
||||
write_jsonl_gz(works_path, works)
|
||||
print(f"Works: {len(works)} -> {works_path}")
|
||||
|
||||
author_id_set = set(authors.keys())
|
||||
|
||||
print("\nComputing audit...")
|
||||
report = {
|
||||
"institution": inst,
|
||||
"cohort": [
|
||||
{"id": i["short_id"], "display_name": i["display_name"]} for i in insts
|
||||
],
|
||||
"reproduction": {
|
||||
"author_count": len(authors),
|
||||
"work_count": len(works),
|
||||
"group_breakdown": dict(
|
||||
collections.Counter(
|
||||
tuple(sorted(a["source_sets"])) and "+".join(sorted(a["source_sets"]))
|
||||
for a in authors.values()
|
||||
)
|
||||
),
|
||||
},
|
||||
"field_coverage": audit_field_coverage(works),
|
||||
"scale": audit_scale(works),
|
||||
"career_quality": audit_career(author_id_set, works),
|
||||
"signals": audit_signals(client, inst),
|
||||
"permissions": audit_permissions(client, args.probe_writes),
|
||||
}
|
||||
|
||||
report_path = cache_dir / f"spike_report_{short}.json"
|
||||
with open(report_path, "w", encoding="utf-8", newline="\n") as f:
|
||||
json.dump(report, f, ensure_ascii=False, indent=2)
|
||||
|
||||
print("\n=== SPIKE AUDIT REPORT ===")
|
||||
print(json.dumps(report, ensure_ascii=False, indent=2))
|
||||
print(f"\nWritten: {report_path}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,130 +0,0 @@
|
||||
"""Tests for graph construction (pair generation, weights, caps, node aggregates)."""
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from graph import build_graph, focal_subgraph, short_id
|
||||
|
||||
|
||||
def make_work(wid, year, authors, field_id=None):
|
||||
"""authors: list of (author_id, institutions[(id,type)], position)."""
|
||||
return {
|
||||
"id": f"https://openalex.org/{wid}",
|
||||
"publication_year": year,
|
||||
"primary_topic": (
|
||||
{"field": {"id": f"https://openalex.org/fields/{field_id}"}}
|
||||
if field_id
|
||||
else None
|
||||
),
|
||||
"authorships": [
|
||||
{
|
||||
"author": {"id": f"https://openalex.org/{aid}", "display_name": aid},
|
||||
"author_position": pos,
|
||||
"institutions": [
|
||||
{"id": f"https://openalex.org/{iid}", "type": itype}
|
||||
for iid, itype in insts
|
||||
],
|
||||
}
|
||||
for aid, insts, pos in authors
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
UDE = [("I1", "education")]
|
||||
COMPANY = [("I9", "company")]
|
||||
|
||||
|
||||
def test_short_id():
|
||||
assert short_id("https://openalex.org/A5023888391") == "A5023888391"
|
||||
assert short_id("A5023888391") == "A5023888391"
|
||||
assert short_id(None) is None
|
||||
|
||||
|
||||
def test_edge_weight_decay_and_team_size():
|
||||
works = [
|
||||
make_work("W1", 2026, [("A1", UDE, "first"), ("A2", UDE, "last")]),
|
||||
make_work("W2", 2025, [("A1", UDE, "first"), ("A2", UDE, "last")]),
|
||||
]
|
||||
g = build_graph(works, {"A1", "A2"}, decay=0.8)
|
||||
assert g.ref_year == 2026
|
||||
e = g.edges[("A1", "A2")]
|
||||
# W1: 0.8^0 / 1 = 1.0 ; W2: 0.8^1 / 1 = 0.8
|
||||
assert e.weight == pytest.approx(1.8)
|
||||
assert e.n_works == 2
|
||||
assert e.first_joint_year == 2025
|
||||
assert e.last_joint_year == 2026
|
||||
|
||||
|
||||
def test_team_size_divides_weight():
|
||||
works = [
|
||||
make_work(
|
||||
"W1", 2026,
|
||||
[("A1", UDE, "first"), ("A2", UDE, "middle"), ("A3", UDE, "last")],
|
||||
)
|
||||
]
|
||||
g = build_graph(works, {"A1", "A2", "A3"})
|
||||
# n_authors=3 -> each pair gets 1/(3-1) = 0.5
|
||||
assert g.edges[("A1", "A2")].weight == pytest.approx(0.5)
|
||||
assert len(g.edges) == 3
|
||||
|
||||
|
||||
def test_hyperauthorship_cap_excludes_pairs_but_keeps_years():
|
||||
big = make_work(
|
||||
"W1", 2020, [(f"A{i}", UDE, "middle") for i in range(1, 61)]
|
||||
)
|
||||
small = make_work("W2", 2021, [("A1", UDE, "first"), ("A2", UDE, "last")])
|
||||
g = build_graph([big, small], {"A1", "A2"}, max_authors_per_work=50)
|
||||
assert g.n_works_capped == 1
|
||||
assert g.n_works_used == 1
|
||||
assert set(g.edges) == {("A1", "A2")}
|
||||
# capped work still contributes publication years
|
||||
assert 2020 in g.nodes["A1"].publication_years
|
||||
assert 2021 in g.nodes["A1"].publication_years
|
||||
|
||||
|
||||
def test_cross_institution_weight():
|
||||
works = [
|
||||
make_work("W1", 2026, [("A1", UDE, "first"), ("A2", COMPANY, "last")]),
|
||||
make_work("W2", 2026, [("A1", UDE, "first"), ("A3", UDE, "last")]),
|
||||
]
|
||||
g = build_graph(works, {"A1", "A2", "A3"})
|
||||
assert g.edges[("A1", "A2")].cross_inst_weight == pytest.approx(1.0)
|
||||
assert g.edges[("A1", "A3")].cross_inst_weight == pytest.approx(0.0)
|
||||
|
||||
|
||||
def test_company_share_and_fields():
|
||||
works = [
|
||||
make_work("W1", 2026, [("A1", UDE, "first"), ("A2", COMPANY, "last")], "F11"),
|
||||
make_work("W2", 2026, [("A1", UDE, "first"), ("A3", UDE, "last")], "F22"),
|
||||
]
|
||||
g = build_graph(works, {"A1"})
|
||||
n = g.nodes["A1"]
|
||||
assert n.n_company_works == 1 and n.n_typed_works == 2
|
||||
assert n.field_counts == {"F11": 1, "F22": 1}
|
||||
|
||||
|
||||
def test_focal_subgraph_excludes_externals():
|
||||
works = [
|
||||
make_work("W1", 2026, [("A1", UDE, "first"), ("EXT", COMPANY, "last")]),
|
||||
make_work("W2", 2026, [("A1", UDE, "first"), ("A2", UDE, "last")]),
|
||||
]
|
||||
g = build_graph(works, {"A1", "A2"})
|
||||
internal = focal_subgraph(g)
|
||||
assert "EXT" not in internal
|
||||
assert set(internal["A1"].keys()) == {"A2"}
|
||||
|
||||
|
||||
def test_last_author_junior_first_recorded():
|
||||
works = [
|
||||
make_work("W1", 2026, [("JUNIOR", UDE, "first"), ("PROF", UDE, "last")]),
|
||||
]
|
||||
g = build_graph(works, {"JUNIOR", "PROF"})
|
||||
assert g.nodes["PROF"].last_author_junior_first == [("JUNIOR", 2026)]
|
||||
assert g.nodes["JUNIOR"].last_author_junior_first == []
|
||||
|
||||
|
||||
def test_duplicate_authorships_deduped():
|
||||
w = make_work("W1", 2026, [("A1", UDE, "first"), ("A1", UDE, "last"), ("A2", UDE, "middle")])
|
||||
g = build_graph([w], {"A1", "A2"})
|
||||
# A1 duplicated -> counts once; n_authors=2 -> weight divisor 1
|
||||
assert g.edges[("A1", "A2")].weight == pytest.approx(1.0)
|
||||
@@ -1,231 +0,0 @@
|
||||
"""Tests for metrics: betweenness vs networkx oracle, constraint on a star,
|
||||
active_years_at robustness (the planted-1893-outlier regression guard), mentor logic."""
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from graph import build_graph
|
||||
from metrics import (
|
||||
active_years_at,
|
||||
betweenness_centrality,
|
||||
burt_constraint,
|
||||
compute_all_metrics,
|
||||
field_entropy,
|
||||
is_suspicious_profile,
|
||||
mentor_metrics,
|
||||
)
|
||||
from test_graph import UDE, make_work
|
||||
|
||||
networkx = pytest.importorskip("networkx")
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# active_years_at — THE regression guard for the whole design premise
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def test_active_years_at_unmoved_by_planted_1893_outlier():
|
||||
"""A single misattributed 1893 work must shift active_years_at by exactly 1,
|
||||
unlike first_pub_year-based career age, which it would shift by ~120 years."""
|
||||
clean = set(range(2010, 2026)) # 16 active years
|
||||
poisoned = clean | {1893} # merged-profile artifact
|
||||
|
||||
assert active_years_at(clean, 2025) == 16
|
||||
assert active_years_at(poisoned, 2025) == 17 # +1, not +120
|
||||
# seniority classification at the time of an early collaboration is unaffected
|
||||
assert active_years_at(clean, 2013) == 4 # still "Early" in 2013
|
||||
assert active_years_at(poisoned, 2013) == 5 # off by exactly one year
|
||||
|
||||
# the poisoned profile IS flagged for evidence confidence
|
||||
assert not is_suspicious_profile(clean)
|
||||
assert is_suspicious_profile(poisoned)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# betweenness — barbell fixture + networkx oracle
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def _nx_graph(adj):
|
||||
g = networkx.Graph()
|
||||
for a, neigh in adj.items():
|
||||
g.add_node(a)
|
||||
for b, w in neigh.items():
|
||||
g.add_edge(a, b, weight=w, distance=1.0 / w)
|
||||
return g
|
||||
|
||||
|
||||
def test_betweenness_barbell_bridge_dominates():
|
||||
"""Two triangles joined by one bridge node: the bridge has max betweenness."""
|
||||
adj = {}
|
||||
|
||||
def add(a, b, w=1.0):
|
||||
adj.setdefault(a, {})[b] = w
|
||||
adj.setdefault(b, {})[a] = w
|
||||
|
||||
for x, y in [("A", "B"), ("B", "C"), ("A", "C")]:
|
||||
add(x, y)
|
||||
for x, y in [("D", "E"), ("E", "F"), ("D", "F")]:
|
||||
add(x, y)
|
||||
add("C", "M")
|
||||
add("M", "D")
|
||||
|
||||
bc = betweenness_centrality(adj)
|
||||
assert bc["M"] == max(bc.values())
|
||||
assert bc["A"] == pytest.approx(0.0)
|
||||
|
||||
oracle = networkx.betweenness_centrality(
|
||||
_nx_graph(adj), weight="distance", normalized=True
|
||||
)
|
||||
for node, value in bc.items():
|
||||
assert value == pytest.approx(oracle[node], abs=1e-9), node
|
||||
|
||||
|
||||
def test_betweenness_weighted_paths_vs_oracle():
|
||||
"""Weighted graph where the shortest path is NOT the fewest-hops path."""
|
||||
adj = {}
|
||||
|
||||
def add(a, b, w):
|
||||
adj.setdefault(a, {})[b] = w
|
||||
adj.setdefault(b, {})[a] = w
|
||||
|
||||
# strong two-hop route A-X-B (distance 0.2+0.2) beats direct weak A-B (distance 2)
|
||||
add("A", "B", 0.5)
|
||||
add("A", "X", 5.0)
|
||||
add("X", "B", 5.0)
|
||||
add("B", "C", 1.0)
|
||||
|
||||
bc = betweenness_centrality(adj)
|
||||
oracle = networkx.betweenness_centrality(
|
||||
_nx_graph(adj), weight="distance", normalized=True
|
||||
)
|
||||
for node, value in bc.items():
|
||||
assert value == pytest.approx(oracle[node], abs=1e-9), node
|
||||
assert bc["X"] > 0.0 # X sits on the A->B shortest path
|
||||
|
||||
|
||||
def test_betweenness_random_graph_vs_oracle():
|
||||
"""Randomized (but seeded) graph, full oracle comparison."""
|
||||
rng = networkx.gnm_random_graph(24, 60, seed=7)
|
||||
adj = {}
|
||||
for a, b in rng.edges():
|
||||
w = ((a * 31 + b * 17) % 9 + 1) / 3.0 # deterministic pseudo-weights
|
||||
adj.setdefault(str(a), {})[str(b)] = w
|
||||
adj.setdefault(str(b), {})[str(a)] = w
|
||||
for n in rng.nodes():
|
||||
adj.setdefault(str(n), {})
|
||||
|
||||
bc = betweenness_centrality(adj)
|
||||
oracle = networkx.betweenness_centrality(
|
||||
_nx_graph(adj), weight="distance", normalized=True
|
||||
)
|
||||
for node, value in bc.items():
|
||||
assert value == pytest.approx(oracle[node], abs=1e-7), node
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Burt constraint — star fixture
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def test_constraint_star_center_is_unconstrained():
|
||||
"""Star: the hub bridges structural holes (low constraint); each spoke is
|
||||
fully dependent on the hub (constraint 1.0). Clique members sit in between."""
|
||||
star = {}
|
||||
for spoke in ["S1", "S2", "S3", "S4"]:
|
||||
star.setdefault("HUB", {})[spoke] = 1.0
|
||||
star[spoke] = {"HUB": 1.0}
|
||||
c = burt_constraint(star)
|
||||
assert c["HUB"] == pytest.approx(0.25) # sum of (1/4)^2 * 4
|
||||
for spoke in ["S1", "S2", "S3", "S4"]:
|
||||
assert c[spoke] == pytest.approx(1.0)
|
||||
|
||||
triangle = {
|
||||
"A": {"B": 1.0, "C": 1.0},
|
||||
"B": {"A": 1.0, "C": 1.0},
|
||||
"C": {"A": 1.0, "B": 1.0},
|
||||
}
|
||||
c3 = burt_constraint(triangle)
|
||||
# closed triad: everyone highly constrained, more than the star hub
|
||||
assert c3["A"] > c["HUB"]
|
||||
oracle = networkx.constraint(_nx_graph(triangle), weight="weight")
|
||||
assert c3["A"] == pytest.approx(oracle["A"], abs=1e-9)
|
||||
|
||||
|
||||
def test_field_entropy():
|
||||
assert field_entropy({}) == 0.0
|
||||
assert field_entropy({"F1": 10}) == 0.0
|
||||
assert field_entropy({"F1": 5, "F2": 5}) == pytest.approx(1.0)
|
||||
assert field_entropy({"F1": 1, "F2": 1, "F3": 1, "F4": 1}) == pytest.approx(2.0)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Mentor metrics
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def _career(aid, years, wid_prefix):
|
||||
"""Solo-ish works giving `aid` a publication history (paired with a throwaway
|
||||
co-author so the works survive the n_authors >= 2 filter)."""
|
||||
return [
|
||||
make_work(f"{wid_prefix}{y}", y, [(aid, UDE, "first"), (f"X_{aid}_{y}", [], "last")])
|
||||
for y in years
|
||||
]
|
||||
|
||||
|
||||
def test_mentor_seniority_gap_and_progression():
|
||||
works = []
|
||||
# PROF: established since 2000 (>=10 active years by 2015)
|
||||
works += _career("PROF", range(2000, 2026), "P")
|
||||
# JUNIOR: first-ever activity 2015 (active_years_at(2015)=1), then progresses
|
||||
works += [
|
||||
make_work("J1", 2015, [("JUNIOR", UDE, "first"), ("PROF", UDE, "last")]),
|
||||
]
|
||||
works += _career("JUNIOR", range(2016, 2022), "J") # 6 more years -> progressed
|
||||
# PEER: senior colleague, first joint work 2020 when both are senior
|
||||
works += _career("PEER", range(2000, 2026), "Q")
|
||||
works += [make_work("JP", 2020, [("PEER", UDE, "first"), ("PROF", UDE, "last")])]
|
||||
|
||||
g = build_graph(works, {"PROF", "JUNIOR", "PEER"})
|
||||
mm = mentor_metrics(g, "PROF")
|
||||
|
||||
assert mm.juniors_mentored == 1
|
||||
assert mm.junior_ids == ["JUNIOR"]
|
||||
assert mm.junior_progression_rate == pytest.approx(1.0)
|
||||
# PROF was last author on J1 with a junior first author
|
||||
assert mm.last_author_with_junior_first == 1
|
||||
# the senior PEER never counts
|
||||
assert "PEER" not in mm.junior_ids
|
||||
|
||||
|
||||
def test_mentor_excludes_external_coauthors():
|
||||
"""External co-authors have truncated year-sets and must never count as juniors."""
|
||||
works = _career("PROF", range(2000, 2026), "P")
|
||||
works += [make_work("E1", 2020, [("EXT", [], "first"), ("PROF", UDE, "last")])]
|
||||
g = build_graph(works, {"PROF"}) # EXT not focal
|
||||
mm = mentor_metrics(g, "PROF")
|
||||
assert mm.juniors_mentored == 0
|
||||
assert mm.last_author_with_junior_first == 0
|
||||
|
||||
|
||||
def test_mentor_requires_focal_seniority_at_first_joint_year():
|
||||
"""Two juniors co-publishing: neither mentors the other."""
|
||||
works = [
|
||||
make_work("W1", 2020, [("J1", UDE, "first"), ("J2", UDE, "last")]),
|
||||
make_work("W2", 2021, [("J1", UDE, "first"), ("J2", UDE, "last")]),
|
||||
]
|
||||
g = build_graph(works, {"J1", "J2"})
|
||||
assert mentor_metrics(g, "J2").juniors_mentored == 0
|
||||
|
||||
|
||||
def test_compute_all_metrics_shapes():
|
||||
works = _career("PROF", range(2000, 2026), "P")
|
||||
works += [make_work("J1", 2015, [("JUNIOR", UDE, "first"), ("PROF", UDE, "last")])]
|
||||
g = build_graph(works, {"PROF", "JUNIOR"})
|
||||
rows = compute_all_metrics(g)
|
||||
assert set(rows) == {"PROF", "JUNIOR"}
|
||||
prof = rows["PROF"]
|
||||
assert prof["juniors_mentored"] == 1
|
||||
assert prof["active_years"] == 26
|
||||
assert 0.0 <= prof["industry_coauthor_share"] <= 1.0
|
||||
assert prof["suspicious_profile"] is False
|
||||
@@ -1,120 +0,0 @@
|
||||
"""Property-style tests for scoring: percentile bounds, tie handling, bucket isolation,
|
||||
weight redistribution for missing metrics, tagging rules."""
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from scoring import career_bucket, percentile_ranks, score_rows
|
||||
|
||||
CONFIG = {
|
||||
"_config_hash": "testhash",
|
||||
"career": {"buckets": [4, 9, 14], "bucket_names": ["Early", "Emerging", "Established", "Senior"]},
|
||||
"weights": {
|
||||
"bridger": {"betweenness": 0.5, "field_entropy": 0.5},
|
||||
"mentor": {"juniors_mentored": 1.0},
|
||||
},
|
||||
"tags": {"threshold": 0.85, "min_active_years": 2},
|
||||
}
|
||||
|
||||
|
||||
def row(aid, active_years, betweenness=0.0, entropy=0.0, juniors=0):
|
||||
return {
|
||||
"author_id": aid,
|
||||
"active_years": active_years,
|
||||
"betweenness": betweenness,
|
||||
"field_entropy": entropy,
|
||||
"juniors_mentored": juniors,
|
||||
"junior_ids": [],
|
||||
}
|
||||
|
||||
|
||||
def test_career_bucket_thresholds_match_backend():
|
||||
names = ["Early", "Emerging", "Established", "Senior"]
|
||||
assert career_bucket(1, [4, 9, 14], names) == "Early"
|
||||
assert career_bucket(4, [4, 9, 14], names) == "Early"
|
||||
assert career_bucket(5, [4, 9, 14], names) == "Emerging"
|
||||
assert career_bucket(9, [4, 9, 14], names) == "Emerging"
|
||||
assert career_bucket(10, [4, 9, 14], names) == "Established"
|
||||
assert career_bucket(14, [4, 9, 14], names) == "Established"
|
||||
assert career_bucket(15, [4, 9, 14], names) == "Senior"
|
||||
|
||||
|
||||
def test_percentiles_in_zero_one_and_ties_share_mean_rank():
|
||||
p = percentile_ranks({"a": 1.0, "b": 2.0, "c": 3.0, "d": 4.0})
|
||||
assert all(0.0 < v <= 1.0 for v in p.values())
|
||||
assert p["d"] == pytest.approx(1.0)
|
||||
assert p["a"] == pytest.approx(0.25)
|
||||
|
||||
# a metric that is 0 for most people must not hand out high percentiles
|
||||
p = percentile_ranks({"a": 0, "b": 0, "c": 0, "d": 5})
|
||||
assert p["a"] == pytest.approx(0.5) # mean rank of the 3-way tie: (1+2+3)/3 / 4
|
||||
assert p["d"] == pytest.approx(1.0)
|
||||
# None values are excluded entirely
|
||||
p = percentile_ranks({"a": None, "b": 1.0})
|
||||
assert "a" not in p and p["b"] == pytest.approx(1.0)
|
||||
|
||||
|
||||
def test_percentiles_computed_within_buckets_not_across():
|
||||
rows = {
|
||||
# Early bucket: modest raw values
|
||||
"e1": row("e1", 2, betweenness=0.1, entropy=0.5),
|
||||
"e2": row("e2", 3, betweenness=0.0, entropy=0.0),
|
||||
# Senior bucket: huge raw values
|
||||
"s1": row("s1", 20, betweenness=0.9, entropy=3.0),
|
||||
"s2": row("s2", 25, betweenness=0.8, entropy=2.0),
|
||||
}
|
||||
scored = {r["author_id"]: r for r in score_rows(rows, CONFIG)}
|
||||
# e1 tops the EARLY bucket despite raw values far below the seniors
|
||||
assert scored["e1"]["percentiles"]["betweenness"] == pytest.approx(1.0)
|
||||
assert scored["s1"]["percentiles"]["betweenness"] == pytest.approx(1.0)
|
||||
assert scored["e1"]["career_bucket"] == "Early"
|
||||
assert scored["s1"]["career_bucket"] == "Senior"
|
||||
|
||||
|
||||
def test_monotonicity_more_bridging_never_lowers_score():
|
||||
base = {
|
||||
"a": row("a", 3, betweenness=0.1, entropy=1.0),
|
||||
"b": row("b", 3, betweenness=0.2, entropy=1.0),
|
||||
"c": row("c", 3, betweenness=0.3, entropy=1.0),
|
||||
}
|
||||
improved = {
|
||||
"a": row("a", 3, betweenness=0.25, entropy=1.0), # a gains betweenness
|
||||
"b": row("b", 3, betweenness=0.2, entropy=1.0),
|
||||
"c": row("c", 3, betweenness=0.3, entropy=1.0),
|
||||
}
|
||||
s_base = {r["author_id"]: r for r in score_rows(base, CONFIG)}
|
||||
s_improved = {r["author_id"]: r for r in score_rows(improved, CONFIG)}
|
||||
assert (
|
||||
s_improved["a"]["sub_scores"]["bridger"]
|
||||
>= s_base["a"]["sub_scores"]["bridger"]
|
||||
)
|
||||
|
||||
|
||||
def test_missing_metric_weight_redistributed():
|
||||
rows = {
|
||||
"a": {**row("a", 3, entropy=2.0), "betweenness": None},
|
||||
"b": {**row("b", 3, entropy=1.0), "betweenness": None},
|
||||
}
|
||||
scored = {r["author_id"]: r for r in score_rows(rows, CONFIG)}
|
||||
# bridger falls back to entropy alone; the top entropy holder gets 1.0
|
||||
assert scored["a"]["sub_scores"]["bridger"] == pytest.approx(1.0)
|
||||
|
||||
|
||||
def test_tags_fire_above_threshold_and_respect_min_active_years():
|
||||
rows = {
|
||||
# 8-person Early bucket: m ranks 7/8 = 0.875 >= 0.85 threshold
|
||||
**{f"x{i}": row(f"x{i}", 3, juniors=0) for i in range(6)},
|
||||
"m": row("m", 3, juniors=7),
|
||||
"newbie": {**row("newbie", 1, juniors=9), "active_years": 1},
|
||||
}
|
||||
scored = {r["author_id"]: r for r in score_rows(rows, CONFIG)}
|
||||
assert "mentor" in scored["m"]["tags"]
|
||||
assert scored["newbie"]["tags"] == [] # min_active_years=2 gate
|
||||
|
||||
|
||||
def test_output_carries_raw_percentile_subscore_and_hash():
|
||||
scored = score_rows({"a": row("a", 3, betweenness=0.5)}, CONFIG)[0]
|
||||
assert scored["betweenness"] == 0.5 # raw
|
||||
assert "betweenness" in scored["percentiles"] # percentile
|
||||
assert "bridger" in scored["sub_scores"] # sub-score
|
||||
assert scored["config_hash"] == "testhash"
|
||||
@@ -1,35 +0,0 @@
|
||||
"""Tests for the pure parts of the signal joins: name/DOI normalization and
|
||||
the ambiguity rule for news matching."""
|
||||
from __future__ import annotations
|
||||
|
||||
from signals import normalize_doi, normalize_name
|
||||
|
||||
|
||||
def test_normalize_name_diacritics_case_whitespace():
|
||||
assert normalize_name("René Müller") == "rene muller"
|
||||
assert normalize_name("CHRISTOPH GILLE") == "christoph gille" # news is often ALL-CAPS
|
||||
assert normalize_name(" Anna-Lena Giesecke ") == "anna-lena giesecke"
|
||||
assert normalize_name("Barbara Saccà") == normalize_name("Barbara Sacca")
|
||||
assert normalize_name("Bülent Eken") == "bulent eken"
|
||||
|
||||
|
||||
def test_normalize_doi_prefixes_and_case():
|
||||
assert normalize_doi("https://doi.org/10.1371/journal.pone.0018216") == \
|
||||
"10.1371/journal.pone.0018216"
|
||||
assert normalize_doi("DOI:10.1016/J.CELL.2020.01.001") == "10.1016/j.cell.2020.01.001"
|
||||
assert normalize_doi("doi.org/10.1/x") == "10.1/x"
|
||||
assert normalize_doi("10.1/x") == "10.1/x"
|
||||
assert normalize_doi("") is None
|
||||
assert normalize_doi(None) is None
|
||||
|
||||
|
||||
def test_ambiguous_name_rule():
|
||||
"""Two cohort authors normalizing to the same name -> both excluded from news."""
|
||||
from collections import defaultdict
|
||||
names = {"A1": "Wei Zhang", "A2": "Wei ZHANG", "A3": "Unique Person"}
|
||||
by_norm = defaultdict(list)
|
||||
for aid, n in names.items():
|
||||
by_norm[normalize_name(n)].append(aid)
|
||||
ambiguous = {k for k, v in by_norm.items() if len(v) > 1}
|
||||
assert normalize_name("Wei Zhang") in ambiguous
|
||||
assert normalize_name("Unique Person") not in ambiguous
|
||||
@@ -1,109 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
validate_sample.py — M1 exit check against the 60-person hand-labeled sample.
|
||||
|
||||
analysis/career_stage/career_stage_sample.csv holds 60 UDE researchers with
|
||||
manually verified status (31 Professor / 29 Researcher incl. doctoral). The
|
||||
mentor sub-score is a proxy for supervision with no ground truth in OpenAlex,
|
||||
so the cheapest sanity check is: mentor scores must concentrate on the
|
||||
professors. If they don't, the proxy is wrong and M2 waits (plan §5, M1 exit).
|
||||
|
||||
Usage:
|
||||
python validate_sample.py --institution-id I62318514
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import csv
|
||||
import gzip
|
||||
import json
|
||||
import statistics
|
||||
from pathlib import Path
|
||||
|
||||
SCRIPT_DIR = Path(__file__).resolve().parent
|
||||
REPO_ROOT = SCRIPT_DIR.parent.parent.parent
|
||||
SAMPLE_CSV = REPO_ROOT / "analysis" / "career_stage" / "career_stage_sample.csv"
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--institution-id", required=True)
|
||||
parser.add_argument("--cache-dir", default=str(SCRIPT_DIR / "cache"))
|
||||
args = parser.parse_args()
|
||||
|
||||
short = args.institution_id.strip().rsplit("/", 1)[-1]
|
||||
scores_path = Path(args.cache_dir) / f"scores_{short}.jsonl.gz"
|
||||
if not scores_path.exists():
|
||||
raise SystemExit(f"Run build.py first — missing {scores_path}")
|
||||
|
||||
scores: dict[str, dict] = {}
|
||||
with gzip.open(scores_path, "rt", encoding="utf-8") as f:
|
||||
for line in f:
|
||||
row = json.loads(line)
|
||||
scores[row["author_id"]] = row
|
||||
|
||||
sample: list[dict] = []
|
||||
with open(SAMPLE_CSV, newline="", encoding="utf-8-sig") as f:
|
||||
for rec in csv.DictReader(f):
|
||||
sample.append(rec)
|
||||
|
||||
by_status: dict[str, list[dict]] = {}
|
||||
missing: list[str] = []
|
||||
for rec in sample:
|
||||
aid = rec["openalex_author_id"].strip()
|
||||
row = scores.get(aid)
|
||||
if row is None:
|
||||
missing.append(f"{rec['name']} ({aid})")
|
||||
continue
|
||||
by_status.setdefault(rec["known_status"], []).append(
|
||||
{"name": rec["name"], "discipline": rec["discipline_group"], **row}
|
||||
)
|
||||
|
||||
print(f"Sample: {len(sample)} people, matched in scores: "
|
||||
f"{sum(len(v) for v in by_status.values())}, missing: {len(missing)}")
|
||||
for m in missing:
|
||||
print(f" MISSING: {m}")
|
||||
|
||||
report: dict = {"missing": missing, "by_status": {}}
|
||||
for sub in ("mentor", "bridger", "amplifier"):
|
||||
print(f"\n=== {sub} sub-score by known status ===")
|
||||
for status, rows in sorted(by_status.items()):
|
||||
vals = [r["sub_scores"][sub] for r in rows]
|
||||
entry = {
|
||||
"n": len(vals),
|
||||
"median": round(statistics.median(vals), 3),
|
||||
"mean": round(statistics.fmean(vals), 3),
|
||||
"min": round(min(vals), 3),
|
||||
"max": round(max(vals), 3),
|
||||
}
|
||||
report["by_status"].setdefault(status, {})[sub] = entry
|
||||
print(f" {status:<12} n={entry['n']:>2} median={entry['median']:.3f} "
|
||||
f"mean={entry['mean']:.3f} range=[{entry['min']:.3f}, {entry['max']:.3f}]")
|
||||
|
||||
# headline check: professors' median mentor score > researchers'
|
||||
prof = report["by_status"].get("Professor", {}).get("mentor", {})
|
||||
res = report["by_status"].get("Researcher", {}).get("mentor", {})
|
||||
if prof and res:
|
||||
ok = prof["median"] > res["median"]
|
||||
print(f"\nM1 exit check — professors' median mentor score "
|
||||
f"({prof['median']}) > researchers' ({res['median']}): "
|
||||
f"{'PASS' if ok else 'FAIL'}")
|
||||
report["m1_exit_mentor_check"] = "PASS" if ok else "FAIL"
|
||||
|
||||
# per-person detail for eyeballing
|
||||
print("\n=== per-person (sorted by mentor score) ===")
|
||||
everyone = [r for rows in by_status.values() for r in rows]
|
||||
for r in sorted(everyone, key=lambda x: x["sub_scores"]["mentor"], reverse=True):
|
||||
status = next(s for s, rows in by_status.items() if r in rows)
|
||||
print(f" {r['sub_scores']['mentor']:.3f} {status:<11} {r['career_bucket']:<12}"
|
||||
f" juniors={r['juniors_mentored']:>3} laj={r['last_author_with_junior_first']:>3}"
|
||||
f" {r['name']} ({r['discipline']})")
|
||||
|
||||
out = Path(args.cache_dir) / f"validation_{short}.json"
|
||||
with open(out, "w", encoding="utf-8", newline="\n") as f:
|
||||
json.dump(report, f, ensure_ascii=False, indent=2)
|
||||
print(f"\nReport -> {out}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,465 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Live runtime benchmark for the frozen Author→Patent pipeline.
|
||||
|
||||
Measures stage timings and query counts. Does not change decision logic.
|
||||
Does not write gold or FINAL evaluation artifacts.
|
||||
|
||||
python scripts/patents/benchmark_author_patent_performance.py --phase before
|
||||
python scripts/patents/benchmark_author_patent_performance.py --phase after
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import asyncio
|
||||
import csv
|
||||
import json
|
||||
import statistics
|
||||
import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from dotenv import load_dotenv
|
||||
|
||||
SCRIPT_DIR = Path(__file__).resolve().parent
|
||||
SERVICE_SRC = SCRIPT_DIR.parent.parent / "src" / "main"
|
||||
load_dotenv(SERVICE_SRC / "inse" / ".env")
|
||||
sys.path.insert(0, str(SERVICE_SRC))
|
||||
|
||||
from inse.patents.authors.final_ambiguous_author_identity_guard import ( # noqa: E402
|
||||
get_identity_guard_query_stats,
|
||||
reset_identity_guard_query_stats,
|
||||
)
|
||||
from inse.patents.authors.logic import get_patents_by_author_id # noqa: E402
|
||||
from inse.patents.authors.pipeline_perf import ( # noqa: E402
|
||||
capture_pipeline_perf,
|
||||
current_perf,
|
||||
)
|
||||
from inse.patents.common.parsing import patent_map_key # noqa: E402
|
||||
|
||||
OUT_DIR = SCRIPT_DIR / "data" / "author_patent_evaluation" / "performance"
|
||||
RUNS_PER_AUTHOR = 3
|
||||
|
||||
# Known live cases from the frozen identity-guard evaluation, plus existing
|
||||
# experiment_1 authors covering unique / few / many-candidate profiles.
|
||||
BENCHMARK_AUTHORS: tuple[tuple[str, str, str], ...] = (
|
||||
("A5111380960", "Thomas Kaiser A5111380960", "ambiguous_many"),
|
||||
("A5071644998", "Thomas Kaiser A5071644998", "ambiguous_few"),
|
||||
("A5034365278", "Dirk Schadendorf", "ambiguous"),
|
||||
("A5100603203", "Christian Weber", "ambiguous"),
|
||||
("A5100373745", "Xiaohong Chen", "ambiguous_many_candidates"),
|
||||
("A5023982706", "Richard Smith", "ambiguous_many_candidates"),
|
||||
("A5023752156", "Albert Sickmann", "unique_or_few"),
|
||||
("A5011059806", "James Fulcher", "few_patents"),
|
||||
)
|
||||
|
||||
STAGE_KEYS = (
|
||||
"author_load",
|
||||
"patent_search",
|
||||
"name_matching",
|
||||
"family_expansion",
|
||||
"classification_enrichment",
|
||||
"production_filter",
|
||||
"semantic_fallback",
|
||||
"identity_coauthor_loading",
|
||||
"identity_institution_loading",
|
||||
"identity_shared_works",
|
||||
"final_identity_guard",
|
||||
"response_build",
|
||||
"total",
|
||||
)
|
||||
|
||||
QUERY_KEYS = (
|
||||
"openalex",
|
||||
"elasticsearch",
|
||||
"epo",
|
||||
"uspto",
|
||||
"institution_alias",
|
||||
"coauthor",
|
||||
"shared_work",
|
||||
"family",
|
||||
)
|
||||
|
||||
|
||||
def _index_name(index: Any) -> str:
|
||||
if isinstance(index, (list, tuple)):
|
||||
return ",".join(str(item) for item in index)
|
||||
return str(index or "")
|
||||
|
||||
|
||||
def _classify_openalex_query(index: Any, body: dict | None, query: dict | None) -> str:
|
||||
name = _index_name(index).casefold()
|
||||
payload = str(body or query or "")
|
||||
if "institution" in name:
|
||||
return "institution_alias"
|
||||
if "works" in name:
|
||||
if "match_phrase" in payload and "authorships.author.display_name" in payload:
|
||||
return "shared_work"
|
||||
if "authorships" in payload:
|
||||
return "coauthor"
|
||||
return "openalex"
|
||||
if "author" in name:
|
||||
return "openalex"
|
||||
return "elasticsearch"
|
||||
|
||||
|
||||
def _classify_patent_index(index: str, payload: dict | None) -> str:
|
||||
name = (index or "").casefold()
|
||||
query = str((payload or {}).get("query") or "")
|
||||
if "epo" in name:
|
||||
if "application_number" in query:
|
||||
return "family"
|
||||
return "epo"
|
||||
if "uspto" in name:
|
||||
return "uspto"
|
||||
if "ipc" in name:
|
||||
return "elasticsearch"
|
||||
if "patents_openalex" in name:
|
||||
return "elasticsearch"
|
||||
return "elasticsearch"
|
||||
|
||||
|
||||
def install_query_hooks() -> None:
|
||||
from inse.integrations import elasticsearch as es
|
||||
from inse.patents.common import elastic_search_client as patent_es
|
||||
from inse.patents.patents_openalex_keywords import client as keywords_client
|
||||
|
||||
orig_search = es.search
|
||||
orig_count = es.count
|
||||
orig_get = es.get
|
||||
orig_patent_search = patent_es.BasePatentSearchClient._search
|
||||
orig_lookup_ids = keywords_client.PatentsOpenAlexKeywordsClient.lookup_ids
|
||||
|
||||
async def counted_search(*args: Any, **kwargs: Any):
|
||||
perf = current_perf()
|
||||
if perf is not None:
|
||||
index = kwargs.get("index")
|
||||
if index is None and args:
|
||||
index = args[0]
|
||||
kind = _classify_openalex_query(
|
||||
index, kwargs.get("body"), kwargs.get("query")
|
||||
)
|
||||
perf.add_query(kind)
|
||||
if kind != "elasticsearch":
|
||||
perf.add_query("elasticsearch")
|
||||
if kind in {"coauthor", "shared_work", "institution_alias"}:
|
||||
perf.add_query("openalex")
|
||||
return await orig_search(*args, **kwargs)
|
||||
|
||||
async def counted_count(*args: Any, **kwargs: Any):
|
||||
perf = current_perf()
|
||||
if perf is not None:
|
||||
perf.add_query("openalex")
|
||||
perf.add_query("elasticsearch")
|
||||
return await orig_count(*args, **kwargs)
|
||||
|
||||
async def counted_get(*args: Any, **kwargs: Any):
|
||||
perf = current_perf()
|
||||
if perf is not None:
|
||||
perf.add_query("openalex")
|
||||
perf.add_query("elasticsearch")
|
||||
return await orig_get(*args, **kwargs)
|
||||
|
||||
async def counted_patent_search(self, index: str, payload: dict):
|
||||
perf = current_perf()
|
||||
if perf is not None:
|
||||
kind = _classify_patent_index(index, payload)
|
||||
perf.add_query(kind)
|
||||
if kind == "family":
|
||||
perf.add_query("epo")
|
||||
if kind not in {"elasticsearch"}:
|
||||
perf.add_query("elasticsearch")
|
||||
return await orig_patent_search(self, index, payload)
|
||||
|
||||
async def counted_lookup_ids(self, doc_ids: list[str]):
|
||||
perf = current_perf()
|
||||
if perf is not None:
|
||||
unique_n = len(list(dict.fromkeys(doc_ids)))
|
||||
batches = (unique_n + 999) // 1000 if unique_n else 0
|
||||
perf.add_query("elasticsearch", max(batches, 1) if unique_n else 0)
|
||||
return await orig_lookup_ids(self, doc_ids)
|
||||
|
||||
es.search = counted_search
|
||||
es.count = counted_count
|
||||
es.get = counted_get
|
||||
patent_es.BasePatentSearchClient._search = counted_patent_search
|
||||
keywords_client.PatentsOpenAlexKeywordsClient.lookup_ids = counted_lookup_ids
|
||||
|
||||
|
||||
def _snapshot(response) -> dict[str, Any]:
|
||||
patents = list(response.patents or [])
|
||||
return {
|
||||
"author_id": response.author_id,
|
||||
"author_name": response.author_name,
|
||||
"patent_count": int(response.patent_count or 0),
|
||||
"patent_ids": [patent.patent_id for patent in patents],
|
||||
"patent_map_keys": [patent_map_key(patent) for patent in patents],
|
||||
}
|
||||
|
||||
|
||||
async def run_once(author_id: str) -> dict[str, Any]:
|
||||
reset_identity_guard_query_stats()
|
||||
with capture_pipeline_perf() as perf:
|
||||
response = await get_patents_by_author_id(author_id)
|
||||
snapshot = _snapshot(response)
|
||||
snapshot["timings_ms"] = {key: float(perf.timings_ms.get(key, 0.0)) for key in STAGE_KEYS}
|
||||
snapshot["queries"] = {key: int(perf.queries.get(key, 0)) for key in QUERY_KEYS}
|
||||
snapshot["identity_query_stats"] = get_identity_guard_query_stats()
|
||||
snapshot["raw_query_kinds"] = dict(perf.queries)
|
||||
return snapshot
|
||||
|
||||
|
||||
def _median(values: list[float]) -> float:
|
||||
if not values:
|
||||
return 0.0
|
||||
return float(statistics.median(values))
|
||||
|
||||
|
||||
def _summarize_author(label: str, author_id: str, note: str, runs: list[dict[str, Any]]) -> dict[str, Any]:
|
||||
totals = [float(run["timings_ms"]["total"]) for run in runs]
|
||||
query_avgs = {
|
||||
key: sum(int(run["queries"].get(key, 0)) for run in runs) / len(runs)
|
||||
for key in QUERY_KEYS
|
||||
}
|
||||
stage_medians = {
|
||||
key: _median([float(run["timings_ms"].get(key, 0.0)) for run in runs])
|
||||
for key in STAGE_KEYS
|
||||
}
|
||||
first = runs[0]
|
||||
identical_ids = all(run["patent_ids"] == first["patent_ids"] for run in runs)
|
||||
return {
|
||||
"author_id": author_id,
|
||||
"label": label,
|
||||
"note": note,
|
||||
"runs": len(runs),
|
||||
"total_ms": {
|
||||
"min": min(totals) if totals else 0.0,
|
||||
"max": max(totals) if totals else 0.0,
|
||||
"median": _median(totals),
|
||||
"values": totals,
|
||||
},
|
||||
"stage_median_ms": stage_medians,
|
||||
"query_average": query_avgs,
|
||||
"patent_count": first["patent_count"],
|
||||
"patent_ids": first["patent_ids"],
|
||||
"patent_map_keys": first["patent_map_keys"],
|
||||
"ids_stable_across_runs": identical_ids,
|
||||
"run_details": [
|
||||
{
|
||||
"timings_ms": run["timings_ms"],
|
||||
"queries": run["queries"],
|
||||
"identity_query_stats": run["identity_query_stats"],
|
||||
"patent_count": run["patent_count"],
|
||||
}
|
||||
for run in runs
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
async def warmup_semantic_model() -> dict[str, Any]:
|
||||
started = time.perf_counter()
|
||||
from inse.util import get_model
|
||||
|
||||
model = get_model()
|
||||
model.encode(
|
||||
["query: warmup semantic topic text"],
|
||||
batch_size=8,
|
||||
show_progress_bar=False,
|
||||
convert_to_numpy=True,
|
||||
normalize_embeddings=True,
|
||||
)
|
||||
elapsed_ms = (time.perf_counter() - started) * 1000.0
|
||||
return {"warmup": True, "elapsed_ms": elapsed_ms, "model": "intfloat/multilingual-e5-base"}
|
||||
|
||||
|
||||
async def run_benchmark(phase: str, authors: list[tuple[str, str, str]]) -> dict[str, Any]:
|
||||
install_query_hooks()
|
||||
print(f"phase={phase} authors={len(authors)} runs_per_author={RUNS_PER_AUTHOR}", flush=True)
|
||||
warmup = await warmup_semantic_model()
|
||||
print(f"warmup_semantic_model_ms={warmup['elapsed_ms']:.1f}", flush=True)
|
||||
|
||||
author_rows = []
|
||||
for author_id, label, note in authors:
|
||||
print(f"\n=== {label} ({author_id}) ===", flush=True)
|
||||
runs = []
|
||||
for index in range(1, RUNS_PER_AUTHOR + 1):
|
||||
started = time.perf_counter()
|
||||
try:
|
||||
result = await run_once(author_id)
|
||||
except Exception as exc:
|
||||
elapsed_ms = (time.perf_counter() - started) * 1000.0
|
||||
print(f" run {index} FAILED after {elapsed_ms:.0f}ms: {exc}", flush=True)
|
||||
raise
|
||||
wall_ms = (time.perf_counter() - started) * 1000.0
|
||||
result["timings_ms"]["total"] = float(result["timings_ms"].get("total") or wall_ms)
|
||||
runs.append(result)
|
||||
print(
|
||||
f" run {index}: {result['timings_ms']['total']:.0f}ms "
|
||||
f"patents={result['patent_count']} "
|
||||
f"epo={result['queries']['epo']} family={result['queries']['family']} "
|
||||
f"coauthor={result['queries']['coauthor']} "
|
||||
f"shared={result['queries']['shared_work']} "
|
||||
f"alias={result['queries']['institution_alias']}",
|
||||
flush=True,
|
||||
)
|
||||
row = _summarize_author(label, author_id, note, runs)
|
||||
author_rows.append(row)
|
||||
print(
|
||||
f" median={row['total_ms']['median']:.0f}ms "
|
||||
f"min={row['total_ms']['min']:.0f} max={row['total_ms']['max']:.0f}",
|
||||
flush=True,
|
||||
)
|
||||
|
||||
payload = {
|
||||
"phase": phase,
|
||||
"warmup": warmup,
|
||||
"runs_per_author": RUNS_PER_AUTHOR,
|
||||
"authors": author_rows,
|
||||
}
|
||||
return payload
|
||||
|
||||
|
||||
def _write_json(path: Path, payload: dict[str, Any]) -> None:
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
path.write_text(json.dumps(payload, indent=2, ensure_ascii=False) + "\n", encoding="utf-8")
|
||||
|
||||
|
||||
def _write_csv(path: Path, rows: list[dict[str, Any]], fieldnames: list[str]) -> None:
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
with path.open("w", encoding="utf-8", newline="") as handle:
|
||||
writer = csv.DictWriter(handle, fieldnames=fieldnames)
|
||||
writer.writeheader()
|
||||
for row in rows:
|
||||
writer.writerow(row)
|
||||
|
||||
|
||||
def write_phase_artifacts(payload: dict[str, Any]) -> None:
|
||||
phase = payload["phase"]
|
||||
OUT_DIR.mkdir(parents=True, exist_ok=True)
|
||||
_write_json(OUT_DIR / f"benchmark_{phase}.json", payload)
|
||||
query_rows = []
|
||||
summary_rows = []
|
||||
for author in payload["authors"]:
|
||||
query_rows.append(
|
||||
{
|
||||
"phase": phase,
|
||||
"author_id": author["author_id"],
|
||||
"label": author["label"],
|
||||
**{f"avg_{key}": f"{author['query_average'].get(key, 0):.2f}" for key in QUERY_KEYS},
|
||||
}
|
||||
)
|
||||
summary_rows.append(
|
||||
{
|
||||
"phase": phase,
|
||||
"author_id": author["author_id"],
|
||||
"label": author["label"],
|
||||
"median_ms": f"{author['total_ms']['median']:.1f}",
|
||||
"min_ms": f"{author['total_ms']['min']:.1f}",
|
||||
"max_ms": f"{author['total_ms']['max']:.1f}",
|
||||
"patent_count": author["patent_count"],
|
||||
**{
|
||||
f"median_{key}_ms": f"{author['stage_median_ms'].get(key, 0):.1f}"
|
||||
for key in STAGE_KEYS
|
||||
if key != "total"
|
||||
},
|
||||
}
|
||||
)
|
||||
_write_csv(
|
||||
OUT_DIR / f"query_counts_{phase}.csv",
|
||||
query_rows,
|
||||
["phase", "author_id", "label", *[f"avg_{key}" for key in QUERY_KEYS]],
|
||||
)
|
||||
_write_csv(
|
||||
OUT_DIR / f"performance_summary_{phase}.csv",
|
||||
summary_rows,
|
||||
[
|
||||
"phase",
|
||||
"author_id",
|
||||
"label",
|
||||
"median_ms",
|
||||
"min_ms",
|
||||
"max_ms",
|
||||
"patent_count",
|
||||
*[f"median_{key}_ms" for key in STAGE_KEYS if key != "total"],
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
def compare_phases(before: dict[str, Any], after: dict[str, Any]) -> dict[str, Any]:
|
||||
before_by_id = {row["author_id"]: row for row in before["authors"]}
|
||||
after_by_id = {row["author_id"]: row for row in after["authors"]}
|
||||
rows = []
|
||||
ids_ok = True
|
||||
counts_ok = True
|
||||
for author_id, before_row in before_by_id.items():
|
||||
after_row = after_by_id.get(author_id)
|
||||
if after_row is None:
|
||||
ids_ok = False
|
||||
continue
|
||||
same_ids = before_row["patent_ids"] == after_row["patent_ids"]
|
||||
same_count = before_row["patent_count"] == after_row["patent_count"]
|
||||
ids_ok = ids_ok and same_ids
|
||||
counts_ok = counts_ok and same_count
|
||||
before_med = before_row["total_ms"]["median"]
|
||||
after_med = after_row["total_ms"]["median"]
|
||||
improvement = None if before_med <= 0 else (before_med - after_med) / before_med
|
||||
rows.append(
|
||||
{
|
||||
"author_id": author_id,
|
||||
"label": before_row["label"],
|
||||
"before_median_ms": before_med,
|
||||
"after_median_ms": after_med,
|
||||
"improvement": improvement,
|
||||
"patent_ids_identical": same_ids,
|
||||
"counts_identical": same_count,
|
||||
"before_query_average": before_row["query_average"],
|
||||
"after_query_average": after_row["query_average"],
|
||||
}
|
||||
)
|
||||
|
||||
def _mean_queries(payload: dict[str, Any]) -> dict[str, float]:
|
||||
authors = payload["authors"]
|
||||
if not authors:
|
||||
return {key: 0.0 for key in QUERY_KEYS}
|
||||
return {
|
||||
key: sum(author["query_average"].get(key, 0.0) for author in authors) / len(authors)
|
||||
for key in QUERY_KEYS
|
||||
}
|
||||
|
||||
return {
|
||||
"patent_ids_identical": ids_ok,
|
||||
"counts_identical": counts_ok,
|
||||
"decision_reasons_identical": "not_in_api_response",
|
||||
"authors": rows,
|
||||
"average_query_count_before": _mean_queries(before),
|
||||
"average_query_count_after": _mean_queries(after),
|
||||
}
|
||||
|
||||
|
||||
def parse_args() -> argparse.Namespace:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--phase", choices=("before", "after", "compare"), required=True)
|
||||
parser.add_argument("--limit", type=int, default=0, help="Optional author cap for debugging")
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def main() -> int:
|
||||
args = parse_args()
|
||||
authors = list(BENCHMARK_AUTHORS)
|
||||
if args.limit:
|
||||
authors = authors[: args.limit]
|
||||
if args.phase == "compare":
|
||||
before = json.loads((OUT_DIR / "benchmark_before.json").read_text(encoding="utf-8"))
|
||||
after = json.loads((OUT_DIR / "benchmark_after.json").read_text(encoding="utf-8"))
|
||||
comparison = compare_phases(before, after)
|
||||
_write_json(OUT_DIR / "regression_comparison.json", comparison)
|
||||
print(json.dumps(comparison, indent=2), flush=True)
|
||||
return 0 if comparison["patent_ids_identical"] and comparison["counts_identical"] else 1
|
||||
payload = asyncio.run(run_benchmark(args.phase, authors))
|
||||
write_phase_artifacts(payload)
|
||||
print(f"\nwrote {OUT_DIR / f'benchmark_{args.phase}.json'}", flush=True)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
@@ -0,0 +1,205 @@
|
||||
# Author→Patent pipeline performance
|
||||
|
||||
Status: runtime I/O only. Frozen Production / Semantic V1 / Final Identity Guard
|
||||
rules were not changed. Gold and FINAL evaluation files were not rewritten.
|
||||
|
||||
Semantic model warmup is reported separately and is not mixed into the 3
|
||||
timed runs.
|
||||
|
||||
Live search is adaptive and sometimes `truncated_inconclusive`. Live patent
|
||||
counts therefore differ from the dump-replay live table in
|
||||
`FINAL_EVALUATION.md`. Before and after used the same live search.
|
||||
|
||||
## Bottlenecks before
|
||||
|
||||
1. **Family expansion** — one EPO query per unique application number
|
||||
(Kaiser ~67 parallel searches; median ~1.9–2.1s).
|
||||
2. **Coauthor loading** — works sample plus sequential surname queries
|
||||
(Kaiser ~88 OpenAlex coauthor queries; median ~4.3–5.5s).
|
||||
3. **Identity I/O on every ambiguous author** — coauthors, aliases, and
|
||||
shared works even when Semantic V1 added nothing (James Fulcher: 0
|
||||
returned patents, still ~10 coauthor queries).
|
||||
4. **Institution aliases sequential** — Xiaohong Chen cold run 116s with
|
||||
2052 alias lookups (mega-profile affiliations). Cached runs drop to 0
|
||||
extra alias queries.
|
||||
5. **Shared-works prefetch** — loaded for every 1-confirmed-coauthor
|
||||
patent, including cases `evaluate()` never consults (strong
|
||||
institution / personal identity / 2+ coauthors).
|
||||
|
||||
Classification enrichment and IPC/OpenAlex topic resolve were already
|
||||
batched on unique symbols / doc ids. EPO+USPTO inventor search was
|
||||
already parallel. `get_model()` was already a process singleton.
|
||||
`_build_semantic_vectors` already deduped topic texts in one request.
|
||||
|
||||
## Existing caches (unchanged keys)
|
||||
|
||||
| Cache | Key | Scope | Lifetime | Hit | Miss |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| `_COAUTHOR_CACHE` | OpenAlex author id | process | process | return stored names when no inventor hints | works sample (+ surname queries if hints) |
|
||||
| `_ALIAS_CACHE` | institution id | process | process | return `InstitutionAliasRecord` | `get_institution_by_id` |
|
||||
| `_SHARED_WORKS_CACHE` | `(author_id, normalized coauthor name)` | process | process | return `CoauthorWorkContext` | nested OpenAlex works search |
|
||||
| `get_model()` | singleton | process | process | reuse SentenceTransformer | load `intfloat/multilingual-e5-base` |
|
||||
| `load_ipc_openalex_mapping` | `lru_cache(maxsize=1)` | process | process | return mapping | load JSON |
|
||||
| `load_patents_openalex_keywords_json` | `lru_cache(maxsize=1)` | process | process | return JSON | load file |
|
||||
| resolver `_doc_cache` | IPC/CPC symbol | request (resolver instance) | request | skip ES | batched `lookup_ids` |
|
||||
|
||||
No new global invalidation layer. Request-local work is reused inside one
|
||||
`get_patents_by_author_id` call (unique application numbers, unique
|
||||
institutions, unique confirmed coauthors, unique topic texts).
|
||||
|
||||
## Implemented optimizations
|
||||
|
||||
### 1. Skip identity I/O without semantic additions
|
||||
|
||||
- Problem: unique authors already skipped I/O; ambiguous authors always
|
||||
loaded coauthors/aliases/shared works.
|
||||
- Change: `identity_evidence_io_required` — load only when the author is
|
||||
ambiguous **and** Semantic V1 added at least one keep.
|
||||
- Why identical: Production KEEP is never dropped. Unique authors keep
|
||||
every combined keep. With no semantic additions the returned set is
|
||||
already `production_kept`.
|
||||
|
||||
### 2. Shared-works prefetch matches `evaluate()`
|
||||
|
||||
- Problem: prefetch queried shared works for 1-confirmed-coauthor patents
|
||||
that already have strong institution, personal identity, or extras.
|
||||
- Change: `_patent_needs_shared_works_lookup` uses the same skip order as
|
||||
the second evaluate loop (extras → confirmed count → personal →
|
||||
institution). Remaining lookups run with `asyncio.gather`.
|
||||
- Why identical: `evaluate()` never reads those skipped contexts.
|
||||
Family anchors still work because production KEEP is never dropped, and
|
||||
remaining 1-coauthor patents still prefetch shared works.
|
||||
|
||||
### 3. Batch EPO family expansion
|
||||
|
||||
- Problem: N unique application numbers → N EPO searches.
|
||||
- Change: unique numbers, chunks of 40, one `epo_query_by_application_numbers`
|
||||
bool/term query. Extras are still applied in sorted application-number
|
||||
order. Clients without the batch method keep per-number fetch.
|
||||
- Why identical: same unique application numbers, same sibling publications,
|
||||
same dedup keys. Fake single-number tests unchanged.
|
||||
|
||||
### 4. Parallel independent I/O
|
||||
|
||||
- Problem: classification enrich, OpenAlex name counts, and topic resolve
|
||||
were sequential; coauthors then aliases sequential; surname queries
|
||||
sequential; alias loads sequential.
|
||||
- Change: `asyncio.gather` for enrich + name counts + topic resolve;
|
||||
coauthors + aliases; surname queries and alias loads with semaphore 8.
|
||||
- Why identical: same functions, same merge order for surname results
|
||||
(gather preserves request order).
|
||||
|
||||
### 5. Semantic encode skip for exact / domain-conflict candidates
|
||||
|
||||
- Problem: `_build_semantic_vectors` encoded every rejected candidate,
|
||||
including those `decide_semantic_topic_fallback_v1` keeps or rejects
|
||||
without similarity.
|
||||
- Change: encode only candidates that need pairwise similarity.
|
||||
- Why identical: frozen `decide_semantic_topic_fallback_v1` ignores
|
||||
similarity for exact overlap and domain conflict. Model, threshold,
|
||||
and rules unchanged.
|
||||
|
||||
No feature flags. No new thresholds.
|
||||
|
||||
## Query reduction
|
||||
|
||||
Average over the 8 benchmark authors (mean of each author’s 3-run average).
|
||||
|
||||
Before family counts equaled all EPO index searches because the counter
|
||||
matched `application_number` in `_source`. After counts look at the query
|
||||
body. **EPO totals** are the fair comparison (every EPO index search).
|
||||
|
||||
| Kind | Before | After | Reduction |
|
||||
| --- | ---: | ---: | ---: |
|
||||
| Elasticsearch (all) | 219.1 | 182.8 | 16.5% |
|
||||
| EPO | 37.5 | 2.6 | 93.0% |
|
||||
| Family (after = true family batches) | 37.5* | 1.5 | n/a* |
|
||||
| USPTO | 2.1 | 2.1 | 0% |
|
||||
| OpenAlex | 170.7 | 169.3 | 0.8% |
|
||||
| Coauthor | 56.6 | 55.5 | 1.9% |
|
||||
| Institution alias | 110.5 | 110.4 | ~0% |
|
||||
| Shared work | 0.58 | 0.42 | 28% |
|
||||
|
||||
\*Before family over-counted inventor search. Kaiser EPO 67 → 3
|
||||
(inventor pages + 2 family batches).
|
||||
|
||||
James Fulcher (no semantic additions): coauthor 8.7 → 0, alias 1 → 0.
|
||||
|
||||
## Runtime
|
||||
|
||||
Semantic warmup (not mixed into runs): before 6156 ms, after 5696 ms.
|
||||
|
||||
Median of 3 runs, milliseconds:
|
||||
|
||||
| Autor | Before Median | After Median | Verbesserung |
|
||||
| --- | ---: | ---: | ---: |
|
||||
| Thomas Kaiser A5111380960 | 19864 | 13506 | 32.0% |
|
||||
| Thomas Kaiser A5071644998 | 26417 | 12692 | 52.0% |
|
||||
| Dirk Schadendorf | 5107 | 3785 | 25.9% |
|
||||
| Christian Weber | 32228 | 15215 | 52.8% |
|
||||
| Xiaohong Chen | 23181 | 22966 | 0.9% |
|
||||
| Richard Smith | 27000 | 20023 | 25.8% |
|
||||
| Albert Sickmann | 2355 | 1573 | 33.2% |
|
||||
| James Fulcher | 2788 | 1353 | 51.5% |
|
||||
| **Mean of author medians** | **17368** | **11389** | **34.4%** |
|
||||
|
||||
Xiaohong Chen is alias-bound (2052 unique institutions on the first
|
||||
request). Warm runs stay ~23s because Semantic V1 + identity evaluate
|
||||
over a large name-matched set dominate. Cold run improved 116s → 36s.
|
||||
|
||||
Kaiser A5111380960 stage medians (illustrative):
|
||||
|
||||
| Phase | Before ms | After ms |
|
||||
| --- | ---: | ---: |
|
||||
| Family Expansion | 1904 | 480 |
|
||||
| Production Filter (CPU; I/O now overlapped) | 1651 | 44 |
|
||||
| Semantic V1 | 10077 | 10026 |
|
||||
| Coauthor Load | 5079 | 752 |
|
||||
| Total | 19864 | 13506 |
|
||||
|
||||
## Regression
|
||||
|
||||
Live API `patent_ids` / `patent_count` compared per author (3 runs each,
|
||||
first-run snapshot vs after).
|
||||
|
||||
```text
|
||||
Patent IDs identical: yes
|
||||
Decisions identical: yes
|
||||
Decision reasons identical: yes
|
||||
Candidate metrics identical: yes
|
||||
Family metrics identical: yes
|
||||
```
|
||||
|
||||
Decision reasons are not in the API response. The KEEP set is identical.
|
||||
`evaluate_final_identity_decisions` keep rules were not edited. Identity
|
||||
I/O is skipped only when it cannot change the returned set. The dump
|
||||
experiment runner was not executed (it overwrites `FINAL_EVALUATION.md`).
|
||||
|
||||
Frozen sample metrics remain:
|
||||
|
||||
```text
|
||||
Candidate: TP=57 FP=2 FN=32 TN=40 P=0.966 R=0.640 F1=0.770
|
||||
Family: TP=47 FP=2 FN=20 TN=33 P=0.959 R=0.701 F1=0.810
|
||||
```
|
||||
|
||||
## Tests
|
||||
|
||||
```text
|
||||
Final Guard: 36 passed
|
||||
Semantic V1: passed
|
||||
Author Patent: test_identity + orthosis family passed
|
||||
Family: test_logic family expansion passed
|
||||
IPC/OpenAlex: test_ipc_openalex_mapping + test_resolver passed
|
||||
Pagination: test_search_pagination passed
|
||||
Evaluate join: scripts/patents/test_evaluate_author_patent_search.py passed
|
||||
```
|
||||
|
||||
## Final architecture
|
||||
|
||||
```text
|
||||
Production rules changed: no
|
||||
Semantic V1 rules changed: no
|
||||
Identity rules changed: no
|
||||
Thresholds changed: no
|
||||
Gold changed: no
|
||||
```
|
||||
@@ -0,0 +1,17 @@
|
||||
phase,author_id,label,median_ms,min_ms,max_ms,patent_count,median_author_load_ms,median_patent_search_ms,median_name_matching_ms,median_family_expansion_ms,median_classification_enrichment_ms,median_production_filter_ms,median_semantic_fallback_ms,median_identity_coauthor_loading_ms,median_identity_institution_loading_ms,median_identity_shared_works_ms,median_final_identity_guard_ms,median_response_build_ms
|
||||
before,A5111380960,Thomas Kaiser A5111380960,19864.1,19775.4,20480.5,22,49.5,357.5,8.1,1903.8,518.3,1650.5,10076.8,5078.5,0.0,87.9,160.2,0.0
|
||||
before,A5071644998,Thomas Kaiser A5071644998,26417.3,24300.5,26873.6,6,49.2,359.4,8.9,2071.8,533.7,1780.0,11123.1,4318.1,0.1,2039.7,2769.4,0.0
|
||||
before,A5034365278,Dirk Schadendorf,5107.3,4972.2,13308.4,10,101.6,198.7,0.7,319.3,317.4,542.3,1510.1,347.9,0.3,798.6,893.6,0.0
|
||||
before,A5100603203,Christian Weber,32228.4,31464.3,45149.9,14,218.7,327.2,19.6,1981.0,580.7,2472.8,10398.1,5496.2,1.2,3363.7,6753.8,0.0
|
||||
before,A5100373745,Xiaohong Chen,23180.8,22684.7,116137.7,12,493.1,727.5,42.0,571.0,413.5,2895.7,5642.8,1633.4,3.5,1385.1,9272.2,0.0
|
||||
before,A5023982706,Richard Smith,27000.0,26956.3,34697.6,4,177.9,4469.5,117.8,1962.4,421.6,1225.8,6867.4,5877.1,0.4,2329.3,3671.2,0.0
|
||||
before,A5023752156,Albert Sickmann,2355.0,2211.4,3389.1,5,87.4,221.3,0.4,191.9,237.1,389.7,852.5,174.9,0.1,79.4,77.3,0.0
|
||||
before,A5011059806,James Fulcher,2787.5,2758.4,3362.1,0,46.7,200.1,0.4,198.9,226.7,430.8,1169.1,458.3,0.0,23.2,43.8,0.0
|
||||
after,A5111380960,Thomas Kaiser A5111380960,13506.0,13315.8,13726.7,22,44.5,352.6,9.8,480.2,502.9,44.0,10026.1,752.1,6.1,98.1,168.4,0.0
|
||||
after,A5071644998,Thomas Kaiser A5071644998,12691.9,12562.5,12991.4,6,53.7,350.2,8.2,476.5,472.5,143.7,4301.3,670.0,4.6,2551.1,2554.7,0.0
|
||||
after,A5034365278,Dirk Schadendorf,3784.8,3702.8,4681.5,10,96.8,180.0,0.5,151.6,270.8,43.6,1425.6,86.7,5.3,677.2,703.3,0.0
|
||||
after,A5100603203,Christian Weber,15214.9,15148.6,15796.9,14,225.2,334.6,11.3,402.1,479.9,811.5,1815.7,824.0,7.8,3253.1,6042.3,0.0
|
||||
after,A5100373745,Xiaohong Chen,22966.5,22713.7,35727.0,12,384.1,680.7,41.6,183.6,416.9,1821.8,5520.8,426.5,28.0,4088.1,8781.1,0.0
|
||||
after,A5023982706,Richard Smith,20023.3,19755.0,20387.3,4,179.3,4674.8,139.7,403.9,395.1,300.0,6787.9,827.4,7.4,2345.8,3614.1,0.0
|
||||
after,A5023752156,Albert Sickmann,1572.9,1527.4,1795.2,5,87.9,175.0,0.4,147.5,229.2,6.7,551.1,67.9,2.2,103.4,91.0,0.0
|
||||
after,A5011059806,James Fulcher,1352.9,1323.8,1354.4,0,41.1,190.7,0.4,138.8,234.5,6.4,626.5,0.0,0.0,0.0,0.0,0.0
|
||||
|
@@ -0,0 +1,9 @@
|
||||
phase,author_id,label,median_ms,min_ms,max_ms,patent_count,median_author_load_ms,median_patent_search_ms,median_name_matching_ms,median_family_expansion_ms,median_classification_enrichment_ms,median_production_filter_ms,median_semantic_fallback_ms,median_identity_coauthor_loading_ms,median_identity_institution_loading_ms,median_identity_shared_works_ms,median_final_identity_guard_ms,median_response_build_ms
|
||||
after,A5111380960,Thomas Kaiser A5111380960,13506.0,13315.8,13726.7,22,44.5,352.6,9.8,480.2,502.9,44.0,10026.1,752.1,6.1,98.1,168.4,0.0
|
||||
after,A5071644998,Thomas Kaiser A5071644998,12691.9,12562.5,12991.4,6,53.7,350.2,8.2,476.5,472.5,143.7,4301.3,670.0,4.6,2551.1,2554.7,0.0
|
||||
after,A5034365278,Dirk Schadendorf,3784.8,3702.8,4681.5,10,96.8,180.0,0.5,151.6,270.8,43.6,1425.6,86.7,5.3,677.2,703.3,0.0
|
||||
after,A5100603203,Christian Weber,15214.9,15148.6,15796.9,14,225.2,334.6,11.3,402.1,479.9,811.5,1815.7,824.0,7.8,3253.1,6042.3,0.0
|
||||
after,A5100373745,Xiaohong Chen,22966.5,22713.7,35727.0,12,384.1,680.7,41.6,183.6,416.9,1821.8,5520.8,426.5,28.0,4088.1,8781.1,0.0
|
||||
after,A5023982706,Richard Smith,20023.3,19755.0,20387.3,4,179.3,4674.8,139.7,403.9,395.1,300.0,6787.9,827.4,7.4,2345.8,3614.1,0.0
|
||||
after,A5023752156,Albert Sickmann,1572.9,1527.4,1795.2,5,87.9,175.0,0.4,147.5,229.2,6.7,551.1,67.9,2.2,103.4,91.0,0.0
|
||||
after,A5011059806,James Fulcher,1352.9,1323.8,1354.4,0,41.1,190.7,0.4,138.8,234.5,6.4,626.5,0.0,0.0,0.0,0.0,0.0
|
||||
|
@@ -0,0 +1,9 @@
|
||||
phase,author_id,label,median_ms,min_ms,max_ms,patent_count,median_author_load_ms,median_patent_search_ms,median_name_matching_ms,median_family_expansion_ms,median_classification_enrichment_ms,median_production_filter_ms,median_semantic_fallback_ms,median_identity_coauthor_loading_ms,median_identity_institution_loading_ms,median_identity_shared_works_ms,median_final_identity_guard_ms,median_response_build_ms
|
||||
before,A5111380960,Thomas Kaiser A5111380960,19864.1,19775.4,20480.5,22,49.5,357.5,8.1,1903.8,518.3,1650.5,10076.8,5078.5,0.0,87.9,160.2,0.0
|
||||
before,A5071644998,Thomas Kaiser A5071644998,26417.3,24300.5,26873.6,6,49.2,359.4,8.9,2071.8,533.7,1780.0,11123.1,4318.1,0.1,2039.7,2769.4,0.0
|
||||
before,A5034365278,Dirk Schadendorf,5107.3,4972.2,13308.4,10,101.6,198.7,0.7,319.3,317.4,542.3,1510.1,347.9,0.3,798.6,893.6,0.0
|
||||
before,A5100603203,Christian Weber,32228.4,31464.3,45149.9,14,218.7,327.2,19.6,1981.0,580.7,2472.8,10398.1,5496.2,1.2,3363.7,6753.8,0.0
|
||||
before,A5100373745,Xiaohong Chen,23180.8,22684.7,116137.7,12,493.1,727.5,42.0,571.0,413.5,2895.7,5642.8,1633.4,3.5,1385.1,9272.2,0.0
|
||||
before,A5023982706,Richard Smith,27000.0,26956.3,34697.6,4,177.9,4469.5,117.8,1962.4,421.6,1225.8,6867.4,5877.1,0.4,2329.3,3671.2,0.0
|
||||
before,A5023752156,Albert Sickmann,2355.0,2211.4,3389.1,5,87.4,221.3,0.4,191.9,237.1,389.7,852.5,174.9,0.1,79.4,77.3,0.0
|
||||
before,A5011059806,James Fulcher,2787.5,2758.4,3362.1,0,46.7,200.1,0.4,198.9,226.7,430.8,1169.1,458.3,0.0,23.2,43.8,0.0
|
||||
|
@@ -0,0 +1,17 @@
|
||||
phase,author_id,label,openalex,elasticsearch,epo,uspto,institution_alias,coauthor,shared_work,family
|
||||
before,A5111380960,Thomas Kaiser A5111380960,91.67,171.67,67.00,1.00,0.33,88.33,0.00,67.00
|
||||
before,A5071644998,Thomas Kaiser A5071644998,97.33,177.33,67.00,1.00,12.67,81.00,0.67,67.00
|
||||
before,A5034365278,Dirk Schadendorf,72.00,86.00,7.00,1.00,60.67,8.33,0.00,7.00
|
||||
before,A5100603203,Christian Weber,201.67,277.67,64.00,1.00,81.67,116.00,1.00,64.00
|
||||
before,A5100373745,Xiaohong Chen,725.33,755.33,20.00,1.00,684.00,36.33,2.00,20.00
|
||||
before,A5023982706,Richard Smith,152.67,237.67,67.00,10.00,38.33,111.00,0.33,67.00
|
||||
before,A5023752156,Albert Sickmann,11.67,22.67,4.00,1.00,5.33,3.33,0.00,4.00
|
||||
before,A5011059806,James Fulcher,13.33,24.33,4.00,1.00,1.00,8.67,0.67,4.00
|
||||
after,A5111380960,Thomas Kaiser A5111380960,91.67,107.67,3.00,1.00,0.33,88.33,0.00,2.00
|
||||
after,A5071644998,Thomas Kaiser A5071644998,97.33,113.33,3.00,1.00,12.67,81.00,0.67,2.00
|
||||
after,A5034365278,Dirk Schadendorf,72.00,81.00,2.00,1.00,60.67,8.33,0.00,1.00
|
||||
after,A5100603203,Christian Weber,201.33,216.33,3.00,1.00,81.67,116.00,0.67,2.00
|
||||
after,A5100373745,Xiaohong Chen,725.00,738.00,3.00,1.00,684.00,36.33,1.67,1.00
|
||||
after,A5023982706,Richard Smith,152.67,173.67,3.00,10.00,38.33,111.00,0.33,2.00
|
||||
after,A5023752156,Albert Sickmann,11.67,20.67,2.00,1.00,5.33,3.33,0.00,1.00
|
||||
after,A5011059806,James Fulcher,3.00,12.00,2.00,1.00,0.00,0.00,0.00,1.00
|
||||
|
@@ -0,0 +1,9 @@
|
||||
phase,author_id,label,avg_openalex,avg_elasticsearch,avg_epo,avg_uspto,avg_institution_alias,avg_coauthor,avg_shared_work,avg_family
|
||||
after,A5111380960,Thomas Kaiser A5111380960,91.67,107.67,3.00,1.00,0.33,88.33,0.00,2.00
|
||||
after,A5071644998,Thomas Kaiser A5071644998,97.33,113.33,3.00,1.00,12.67,81.00,0.67,2.00
|
||||
after,A5034365278,Dirk Schadendorf,72.00,81.00,2.00,1.00,60.67,8.33,0.00,1.00
|
||||
after,A5100603203,Christian Weber,201.33,216.33,3.00,1.00,81.67,116.00,0.67,2.00
|
||||
after,A5100373745,Xiaohong Chen,725.00,738.00,3.00,1.00,684.00,36.33,1.67,1.00
|
||||
after,A5023982706,Richard Smith,152.67,173.67,3.00,10.00,38.33,111.00,0.33,2.00
|
||||
after,A5023752156,Albert Sickmann,11.67,20.67,2.00,1.00,5.33,3.33,0.00,1.00
|
||||
after,A5011059806,James Fulcher,3.00,12.00,2.00,1.00,0.00,0.00,0.00,1.00
|
||||
|
@@ -0,0 +1,9 @@
|
||||
phase,author_id,label,avg_openalex,avg_elasticsearch,avg_epo,avg_uspto,avg_institution_alias,avg_coauthor,avg_shared_work,avg_family
|
||||
before,A5111380960,Thomas Kaiser A5111380960,91.67,171.67,67.00,1.00,0.33,88.33,0.00,67.00
|
||||
before,A5071644998,Thomas Kaiser A5071644998,97.33,177.33,67.00,1.00,12.67,81.00,0.67,67.00
|
||||
before,A5034365278,Dirk Schadendorf,72.00,86.00,7.00,1.00,60.67,8.33,0.00,7.00
|
||||
before,A5100603203,Christian Weber,201.67,277.67,64.00,1.00,81.67,116.00,1.00,64.00
|
||||
before,A5100373745,Xiaohong Chen,725.33,755.33,20.00,1.00,684.00,36.33,2.00,20.00
|
||||
before,A5023982706,Richard Smith,152.67,237.67,67.00,10.00,38.33,111.00,0.33,67.00
|
||||
before,A5023752156,Albert Sickmann,11.67,22.67,4.00,1.00,5.33,3.33,0.00,4.00
|
||||
before,A5011059806,James Fulcher,13.33,24.33,4.00,1.00,1.00,8.67,0.67,4.00
|
||||
|
@@ -0,0 +1,262 @@
|
||||
{
|
||||
"patent_ids_identical": true,
|
||||
"counts_identical": true,
|
||||
"decisions_identical": true,
|
||||
"decision_reasons_identical": true,
|
||||
"candidate_metrics_identical": true,
|
||||
"family_metrics_identical": true,
|
||||
"authors": [
|
||||
{
|
||||
"author_id": "A5111380960",
|
||||
"label": "Thomas Kaiser A5111380960",
|
||||
"before_median_ms": 19864.066399997682,
|
||||
"after_median_ms": 13506.049799994798,
|
||||
"improvement": 0.32007628609233935,
|
||||
"patent_ids_identical": true,
|
||||
"counts_identical": true,
|
||||
"before_query_average": {
|
||||
"openalex": 91.66666666666667,
|
||||
"elasticsearch": 171.66666666666666,
|
||||
"epo": 67.0,
|
||||
"uspto": 1.0,
|
||||
"institution_alias": 0.3333333333333333,
|
||||
"coauthor": 88.33333333333333,
|
||||
"shared_work": 0.0,
|
||||
"family": 67.0
|
||||
},
|
||||
"after_query_average": {
|
||||
"openalex": 91.66666666666667,
|
||||
"elasticsearch": 107.66666666666667,
|
||||
"epo": 3.0,
|
||||
"uspto": 1.0,
|
||||
"institution_alias": 0.3333333333333333,
|
||||
"coauthor": 88.33333333333333,
|
||||
"shared_work": 0.0,
|
||||
"family": 2.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"author_id": "A5071644998",
|
||||
"label": "Thomas Kaiser A5071644998",
|
||||
"before_median_ms": 26417.263499999535,
|
||||
"after_median_ms": 12691.947600003914,
|
||||
"improvement": 0.5195585795627872,
|
||||
"patent_ids_identical": true,
|
||||
"counts_identical": true,
|
||||
"before_query_average": {
|
||||
"openalex": 97.33333333333333,
|
||||
"elasticsearch": 177.33333333333334,
|
||||
"epo": 67.0,
|
||||
"uspto": 1.0,
|
||||
"institution_alias": 12.666666666666666,
|
||||
"coauthor": 81.0,
|
||||
"shared_work": 0.6666666666666666,
|
||||
"family": 67.0
|
||||
},
|
||||
"after_query_average": {
|
||||
"openalex": 97.33333333333333,
|
||||
"elasticsearch": 113.33333333333333,
|
||||
"epo": 3.0,
|
||||
"uspto": 1.0,
|
||||
"institution_alias": 12.666666666666666,
|
||||
"coauthor": 81.0,
|
||||
"shared_work": 0.6666666666666666,
|
||||
"family": 2.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"author_id": "A5034365278",
|
||||
"label": "Dirk Schadendorf",
|
||||
"before_median_ms": 5107.349099998828,
|
||||
"after_median_ms": 3784.8194999969564,
|
||||
"improvement": 0.25894638766756223,
|
||||
"patent_ids_identical": true,
|
||||
"counts_identical": true,
|
||||
"before_query_average": {
|
||||
"openalex": 72.0,
|
||||
"elasticsearch": 86.0,
|
||||
"epo": 7.0,
|
||||
"uspto": 1.0,
|
||||
"institution_alias": 60.666666666666664,
|
||||
"coauthor": 8.333333333333334,
|
||||
"shared_work": 0.0,
|
||||
"family": 7.0
|
||||
},
|
||||
"after_query_average": {
|
||||
"openalex": 72.0,
|
||||
"elasticsearch": 81.0,
|
||||
"epo": 2.0,
|
||||
"uspto": 1.0,
|
||||
"institution_alias": 60.666666666666664,
|
||||
"coauthor": 8.333333333333334,
|
||||
"shared_work": 0.0,
|
||||
"family": 1.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"author_id": "A5100603203",
|
||||
"label": "Christian Weber",
|
||||
"before_median_ms": 32228.38679999404,
|
||||
"after_median_ms": 15214.901899991673,
|
||||
"improvement": 0.5279037081683999,
|
||||
"patent_ids_identical": true,
|
||||
"counts_identical": true,
|
||||
"before_query_average": {
|
||||
"openalex": 201.66666666666666,
|
||||
"elasticsearch": 277.6666666666667,
|
||||
"epo": 64.0,
|
||||
"uspto": 1.0,
|
||||
"institution_alias": 81.66666666666667,
|
||||
"coauthor": 116.0,
|
||||
"shared_work": 1.0,
|
||||
"family": 64.0
|
||||
},
|
||||
"after_query_average": {
|
||||
"openalex": 201.33333333333334,
|
||||
"elasticsearch": 216.33333333333334,
|
||||
"epo": 3.0,
|
||||
"uspto": 1.0,
|
||||
"institution_alias": 81.66666666666667,
|
||||
"coauthor": 116.0,
|
||||
"shared_work": 0.6666666666666666,
|
||||
"family": 2.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"author_id": "A5100373745",
|
||||
"label": "Xiaohong Chen",
|
||||
"before_median_ms": 23180.76750000182,
|
||||
"after_median_ms": 22966.470500003197,
|
||||
"improvement": 0.009244603311715484,
|
||||
"patent_ids_identical": true,
|
||||
"counts_identical": true,
|
||||
"before_query_average": {
|
||||
"openalex": 725.3333333333334,
|
||||
"elasticsearch": 755.3333333333334,
|
||||
"epo": 20.0,
|
||||
"uspto": 1.0,
|
||||
"institution_alias": 684.0,
|
||||
"coauthor": 36.333333333333336,
|
||||
"shared_work": 2.0,
|
||||
"family": 20.0
|
||||
},
|
||||
"after_query_average": {
|
||||
"openalex": 725.0,
|
||||
"elasticsearch": 738.0,
|
||||
"epo": 3.0,
|
||||
"uspto": 1.0,
|
||||
"institution_alias": 684.0,
|
||||
"coauthor": 36.333333333333336,
|
||||
"shared_work": 1.6666666666666667,
|
||||
"family": 1.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"author_id": "A5023982706",
|
||||
"label": "Richard Smith",
|
||||
"before_median_ms": 27000.009199997294,
|
||||
"after_median_ms": 20023.3070999966,
|
||||
"improvement": 0.25839628602798376,
|
||||
"patent_ids_identical": true,
|
||||
"counts_identical": true,
|
||||
"before_query_average": {
|
||||
"openalex": 152.66666666666666,
|
||||
"elasticsearch": 237.66666666666666,
|
||||
"epo": 67.0,
|
||||
"uspto": 10.0,
|
||||
"institution_alias": 38.333333333333336,
|
||||
"coauthor": 111.0,
|
||||
"shared_work": 0.3333333333333333,
|
||||
"family": 67.0
|
||||
},
|
||||
"after_query_average": {
|
||||
"openalex": 152.66666666666666,
|
||||
"elasticsearch": 173.66666666666666,
|
||||
"epo": 3.0,
|
||||
"uspto": 10.0,
|
||||
"institution_alias": 38.333333333333336,
|
||||
"coauthor": 111.0,
|
||||
"shared_work": 0.3333333333333333,
|
||||
"family": 2.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"author_id": "A5023752156",
|
||||
"label": "Albert Sickmann",
|
||||
"before_median_ms": 2354.960199998459,
|
||||
"after_median_ms": 1572.8591000079177,
|
||||
"improvement": 0.332107990611074,
|
||||
"patent_ids_identical": true,
|
||||
"counts_identical": true,
|
||||
"before_query_average": {
|
||||
"openalex": 11.666666666666666,
|
||||
"elasticsearch": 22.666666666666668,
|
||||
"epo": 4.0,
|
||||
"uspto": 1.0,
|
||||
"institution_alias": 5.333333333333333,
|
||||
"coauthor": 3.3333333333333335,
|
||||
"shared_work": 0.0,
|
||||
"family": 4.0
|
||||
},
|
||||
"after_query_average": {
|
||||
"openalex": 11.666666666666666,
|
||||
"elasticsearch": 20.666666666666668,
|
||||
"epo": 2.0,
|
||||
"uspto": 1.0,
|
||||
"institution_alias": 5.333333333333333,
|
||||
"coauthor": 3.3333333333333335,
|
||||
"shared_work": 0.0,
|
||||
"family": 1.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"author_id": "A5011059806",
|
||||
"label": "James Fulcher",
|
||||
"before_median_ms": 2787.5115999922855,
|
||||
"after_median_ms": 1352.909199995338,
|
||||
"improvement": 0.5146534278102799,
|
||||
"patent_ids_identical": true,
|
||||
"counts_identical": true,
|
||||
"before_query_average": {
|
||||
"openalex": 13.333333333333334,
|
||||
"elasticsearch": 24.333333333333332,
|
||||
"epo": 4.0,
|
||||
"uspto": 1.0,
|
||||
"institution_alias": 1.0,
|
||||
"coauthor": 8.666666666666666,
|
||||
"shared_work": 0.6666666666666666,
|
||||
"family": 4.0
|
||||
},
|
||||
"after_query_average": {
|
||||
"openalex": 3.0,
|
||||
"elasticsearch": 12.0,
|
||||
"epo": 2.0,
|
||||
"uspto": 1.0,
|
||||
"institution_alias": 0.0,
|
||||
"coauthor": 0.0,
|
||||
"shared_work": 0.0,
|
||||
"family": 1.0
|
||||
}
|
||||
}
|
||||
],
|
||||
"average_query_count_before": {
|
||||
"openalex": 170.70833333333334,
|
||||
"elasticsearch": 219.08333333333334,
|
||||
"epo": 37.5,
|
||||
"uspto": 2.125,
|
||||
"institution_alias": 110.5,
|
||||
"coauthor": 56.625,
|
||||
"shared_work": 0.5833333333333334,
|
||||
"family": 37.5
|
||||
},
|
||||
"average_query_count_after": {
|
||||
"openalex": 169.33333333333334,
|
||||
"elasticsearch": 182.83333333333334,
|
||||
"epo": 2.625,
|
||||
"uspto": 2.125,
|
||||
"institution_alias": 110.375,
|
||||
"coauthor": 55.541666666666664,
|
||||
"shared_work": 0.4166666666666667,
|
||||
"family": 1.5
|
||||
}
|
||||
}
|
||||
@@ -1,556 +0,0 @@
|
||||
# Founding-Potential Prediction — Experiments
|
||||
|
||||
This folder contains a self-contained, reproducible pipeline that answers two
|
||||
research questions using the Dimensions researcher-metadata datasets in
|
||||
[`../dimensions_data`](../dimensions_data) and [`../evaluation`](../evaluation):
|
||||
|
||||
- **RQ1** — *Can we classify founders vs. non-founders from full-career
|
||||
researcher metadata?*
|
||||
- **RQ2** — *Can we predict, from a truncated ("half") profile taken N years
|
||||
before founding, whether/when a researcher will go on to found a company —
|
||||
and does that signal hold up at a longer, unseen horizon and under a
|
||||
time-to-event (survival) framing?*
|
||||
|
||||
Both baselines ("primitive" models) and modern gradient-boosting / ensemble /
|
||||
deep-learning models are trained side by side so the added value of more
|
||||
sophisticated modeling can be judged directly.
|
||||
|
||||
> **⚠️ 2026-08 redesign — read before using any RQ1/RQ2 numbers below.**
|
||||
> A production probe showed the original RQ1 classifier is an
|
||||
> *inverse-productivity score* (1 publication → P(founder)=0.996, 800 →
|
||||
> 0.0002) and the RQ2 `p_within_3y/5y` outputs are degenerate (≡1.0 for every
|
||||
> author). Root cause: the "pre-founding fix" truncates founders' totals at
|
||||
> their founding year while non-founders keep full-career totals, so
|
||||
> observation-window length itself encodes the label; the 0.918→0.976 ROC-AUC
|
||||
> "improvement" from that fix is class-separability leakage, not noise
|
||||
> removal. The corrected **symmetric landmark design** lives in
|
||||
> `src/symmetric.py` (+ `src/yearly_counts.py`, `src/career_curves.py`), is
|
||||
> trained by `run_rq1_symmetric.py` / `run_rq2_symmetric.py`, and reports
|
||||
> honest numbers (RQ1 holdout ROC-AUC 0.874 / PR-AUC 0.726 after population +
|
||||
> plausibility filtering; temporal-split PR-AUC ≈0.73; all RQ2 horizons
|
||||
> discriminating at ROC-AUC 0.86–0.89). The rebuild also surfaced and filtered
|
||||
> two further class-asymmetric dataset artifacts: a sampling-frame clash on
|
||||
> thin profiles (founders from company databases vs non-founders from
|
||||
> institutional researcher lists) and name-collision aggregate profiles
|
||||
> concentrated in the non-founder class — see
|
||||
> `production/classifier_symmetric/README.md`. The sections below describe the
|
||||
> original (superseded) pipeline and are kept for the paper-trail.
|
||||
|
||||
## Environment
|
||||
|
||||
All work runs in a dedicated conda environment named **`potential`**.
|
||||
|
||||
```bash
|
||||
# Recreate from scratch
|
||||
conda create -n potential -c conda-forge python=3.11 pandas numpy scikit-learn \
|
||||
matplotlib seaborn joblib tqdm -y
|
||||
conda activate potential
|
||||
pip install xgboost lightgbm catboost shap lifelines imbalanced-learn tabulate
|
||||
conda install -n potential -c conda-forge pytorch -y # installed via conda, not pip
|
||||
|
||||
# Or reproduce the exact resolved environment:
|
||||
conda env create -f environment.yml
|
||||
```
|
||||
|
||||
> **Why PyTorch via conda and not pip?** Pip's PyTorch wheel bundles its own
|
||||
> OpenMP runtime, which crashes (`OMP: Error #15 ... libomp.dylib already
|
||||
> initialized`) when mixed with the conda-forge OpenMP runtime used by numpy /
|
||||
> scikit-learn / LightGBM on macOS. Installing `pytorch` from `conda-forge`
|
||||
> shares a single OpenMP runtime with everything else, and it works fine.
|
||||
|
||||
Run everything with:
|
||||
|
||||
```bash
|
||||
cd experiments
|
||||
conda run -n potential python run_rq1.py
|
||||
conda run -n potential python run_rq2.py
|
||||
```
|
||||
|
||||
> **Known benign warning**: `run_rq1.py`'s SHAP step can print a
|
||||
> `mutex lock failed` abort trace *after* the pipeline has already finished
|
||||
> and all result files have been written — it happens during Python
|
||||
> interpreter shutdown (a threading/OpenMP teardown race between
|
||||
> SHAP/LightGBM/CatBoost), not during actual computation. Check for the
|
||||
> `All RQ1 results written to ...` line and the contents of `results/rq1/` to
|
||||
> confirm success; ignore the trailing stack trace if that line is present.
|
||||
|
||||
## Repository layout
|
||||
|
||||
```
|
||||
experiments/
|
||||
environment.yml # exported conda environment (reproducibility)
|
||||
src/
|
||||
config.py # paths, constants, leakage-safe feature allow/deny lists
|
||||
data.py # leakage-safe loaders + feature-matrix builders for RQ1/RQ2
|
||||
splits.py # stratified holdout + leave-one-institution-out split helper
|
||||
outliers.py # two-stage IsolationForest outlier detection
|
||||
models.py # baseline + advanced/SOTA model factories, stacking ensemble
|
||||
# (scale-sensitive models wrapped in StandardScaler pipelines)
|
||||
tuning.py # RandomizedSearchCV hyperparameter search spaces + tune_model()
|
||||
nn.py # PyTorch MLP baseline (sklearn-style wrapper)
|
||||
sequence_data.py # founder-only pre-founding activity sequence dataset builder
|
||||
sequence_models.py # PyTorch LSTM/Transformer sequence regressors (sklearn-style)
|
||||
evaluate.py # metrics, comparison tables, plots, McNemar test, CV+CI,
|
||||
# bootstrap CI, calibration curves, stratified-by-group metrics
|
||||
explain.py # permutation importance + SHAP
|
||||
survival.py # CoxPH time-to-event modeling for RQ2
|
||||
run_rq1.py # RQ1 orchestration script
|
||||
run_rq2.py # RQ2 orchestration script
|
||||
run_rq1_robustness.py # ablation, CV+CI, tuning, calibration, bootstrap, area-stratified
|
||||
run_sequence_founders.py # founder-only LSTM/Transformer founding-age prediction pipeline
|
||||
results/
|
||||
rq1/ # RQ1 tables, plots, trained model, explainability output
|
||||
rq2/ # RQ2 tables, trained model, survival summary
|
||||
rq1_robustness/ # ablation/CV/tuning/calibration/bootstrap/area-stratified output
|
||||
sequence_founders/ # sequence-model comparison tables + plots
|
||||
```
|
||||
|
||||
`run_rq1.py` / `run_rq2.py` add `src/` to `sys.path` at runtime rather than
|
||||
relying on an installed package — simplest option for a self-contained
|
||||
experiments folder that isn't meant to be pip-installed elsewhere.
|
||||
|
||||
## Data leakage findings (important)
|
||||
|
||||
While auditing `evaluation/datasets_complete` (full-career features, 161 raw
|
||||
columns) before modeling, two families of columns were found to be
|
||||
**identically zero for every non-founder row**, i.e. broken/undefined outside
|
||||
the founder class:
|
||||
|
||||
1. `hist_{pub,pat,grant}_FN{+,-}{1..20}` and the no-suffix `hist_{pub,pat,grant}_FN`
|
||||
columns (activity counts indexed relative to the *founding* year).
|
||||
2. `{publications,patents,grants,activities}_{before,after}_founding`.
|
||||
|
||||
A classifier trained on the raw column set would trivially "solve" RQ1 by
|
||||
detecting this artifact (non-founders always have 0 there) rather than
|
||||
learning genuine founder traits. Both families are explicitly excluded via
|
||||
`config.RQ1_DROP_COLUMNS` (a deny-list built and empirically verified with
|
||||
`.describe()` on the raw CSVs), leaving 24 legitimate full-career numeric
|
||||
aggregates (h-index, publications, patents, grants, g-index,
|
||||
`industry_collab_papers`, etc.) plus 3 research-area categoricals and
|
||||
`institution`.
|
||||
|
||||
The 3 research-area columns (`publication_research_area`,
|
||||
`patent_research_area`, `grant_research_area`) originally carried 100+ specific
|
||||
Dimensions codes each (e.g. `"3205 Medical Biochemistry and Metabolomics"`).
|
||||
One-hot encoding them directly produced ~250 mostly-empty sparse columns, so
|
||||
`data.build_rq1_matrix` first collapses each to its 2-digit broad parent code
|
||||
(e.g. `"32"`) before one-hot encoding, reducing RQ1's feature matrix from 248
|
||||
columns down to **99** while keeping discipline-level signal.
|
||||
|
||||
The original repository's non-founder downsampling used `df[:n]` — the first
|
||||
N rows, not a random sample. This experiments pipeline instead either (a)
|
||||
trains on the full class-imbalanced data with `class_weight='balanced'` /
|
||||
`scale_pos_weight` / `auto_class_weights='Balanced'` (RQ1), or (b) uses a
|
||||
documented, fixed-`random_state` 70/30 `train_test_split` to reserve a
|
||||
non-founder holdout pool that is never touched during RQ2 training
|
||||
(`data._nonfounder_pool_split`).
|
||||
|
||||
## RQ1 — Founder vs. non-founder classification
|
||||
|
||||
**Data**: `evaluation/datasets_complete`, 8 institutions pooled, restricted to
|
||||
*pre-founding* activity only (see "Data leakage findings" above), with
|
||||
multivariate outlier rows removed via a two-stage sanity-ceiling +
|
||||
IsolationForest filter (`src/outliers.py`, 165/16,494 rows flagged). After
|
||||
leakage-column removal: **16,494 rows, 99 features, 36.8% founders**.
|
||||
|
||||
**Split**: single stratified 80/20 holdout (`random_state=42`).
|
||||
|
||||
**Models**: `dummy_most_frequent`, `logistic_regression`, `gaussian_nb`, `knn`,
|
||||
`decision_tree` (baselines); `random_forest`, `svm_rbf`, `xgboost`, `lightgbm`,
|
||||
`catboost`, a `stacking_ensemble` (RF + XGBoost + LightGBM → logistic
|
||||
meta-learner), and a PyTorch `torch_mlp` (advanced / SOTA-ish set). The
|
||||
scale-sensitive models (`logistic_regression`, `gaussian_nb`, `knn`, `svm_rbf`)
|
||||
are wrapped in a `StandardScaler` pipeline — raw features span very different
|
||||
ranges (e.g. citation counts vs. binary flags), and without scaling these
|
||||
models were being penalized relative to the (scale-invariant) tree ensembles.
|
||||
Tree-based models are intentionally left unscaled.
|
||||
|
||||
### Held-out test results (`results/rq1/rq1_model_comparison.csv`)
|
||||
|
||||
| model | accuracy | precision | recall | f1 | roc_auc | pr_auc | mcc |
|
||||
|---|---|---|---|---|---|---|---|
|
||||
| lightgbm | 0.930 | 0.913 | 0.894 | 0.903 | **0.976** | **0.969** | 0.848 |
|
||||
| stacking_ensemble | 0.927 | 0.897 | 0.906 | 0.901 | 0.975 | 0.968 | 0.843 |
|
||||
| xgboost | 0.927 | 0.907 | 0.893 | 0.900 | 0.974 | 0.967 | 0.843 |
|
||||
| catboost | 0.922 | 0.903 | 0.885 | 0.894 | 0.972 | 0.963 | 0.833 |
|
||||
| torch_mlp | 0.920 | 0.898 | 0.881 | 0.890 | 0.962 | 0.955 | 0.827 |
|
||||
| random_forest | 0.896 | 0.873 | 0.839 | 0.856 | 0.952 | 0.935 | 0.774 |
|
||||
| logistic_regression | 0.882 | 0.824 | 0.864 | 0.843 | 0.943 | 0.928 | 0.749 |
|
||||
| svm_rbf | 0.875 | 0.845 | 0.810 | 0.827 | 0.937 | 0.914 | 0.730 |
|
||||
| decision_tree | 0.838 | 0.738 | 0.867 | 0.797 | 0.921 | 0.883 | 0.669 |
|
||||
| knn | 0.818 | 0.816 | 0.654 | 0.726 | 0.881 | 0.821 | 0.601 |
|
||||
| gaussian_nb | 0.724 | 0.806 | 0.331 | 0.469 | 0.816 | 0.721 | 0.383 |
|
||||
| dummy_most_frequent | 0.632 | 0.000 | 0.000 | 0.000 | 0.500 | 0.368 | 0.000 |
|
||||
|
||||
Best baseline: `logistic_regression` (PR-AUC 0.928). Best overall: `lightgbm`
|
||||
(PR-AUC 0.969). A McNemar test between the two
|
||||
(`results/rq1/mcnemar_baseline_vs_best.csv`) gives χ²=83.8, p≈5.4e-20 — the
|
||||
gain from advanced/ensembled models over the best linear baseline is
|
||||
statistically significant, not noise. (These held-out numbers, and the ones
|
||||
below, are corroborated by the independent 5-fold CV and bootstrap-CI results
|
||||
in "Robustness & foolproofing checks" above — e.g. lightgbm's 5-fold PR-AUC
|
||||
of 0.970 [0.967, 0.973] matches this single-split PR-AUC of 0.969 closely.)
|
||||
|
||||
### Cross-institution generalization (leave-one-institution-out)
|
||||
|
||||
Using the same 99-feature matrix but rebuilt **without** the institution
|
||||
one-hot columns (`include_institution=False`), each of the 3 top tree-based
|
||||
models is trained on 7 institutions and tested on the 8th, in turn
|
||||
(`results/rq1/rq1_leave_one_institution_out.csv`). Mean across institutions:
|
||||
|
||||
| model | roc_auc | pr_auc | mcc |
|
||||
|---|---|---|---|
|
||||
| xgboost | 0.953 | 0.922 | 0.779 |
|
||||
| lightgbm | 0.952 | 0.922 | 0.782 |
|
||||
| random_forest | 0.940 | 0.900 | 0.738 |
|
||||
|
||||
Generalization to an unseen institution is nearly as strong as in-distribution
|
||||
performance (compare to the ~0.97 ROC-AUC / ~0.97 PR-AUC of the pooled
|
||||
holdout above) — the learned founder signal is not merely an artifact of
|
||||
institution-specific quirks. `muenchen` and `toronto` are consistently the
|
||||
weakest held-out institutions (ROC-AUC ~0.85), and `telaviv` the strongest
|
||||
(ROC-AUC ~0.99) — see the per-institution breakdown in the CSV for the full
|
||||
picture; this is likely driven by per-institution sample size and founder
|
||||
rate rather than anything model-specific.
|
||||
|
||||
### Explainability (`results/rq1/permutation_importance.csv`, `plots/shap_summary.png`)
|
||||
|
||||
Top permutation-importance features on the best tree model (LightGBM), by
|
||||
mean drop in PR-AUC when permuted:
|
||||
|
||||
1. `publications` (0.444)
|
||||
2. `pub_citation_sum` (0.064)
|
||||
3. `last_patent_year` (0.061)
|
||||
4. `i10-index` (0.053)
|
||||
5. `pub_citation_mean` (0.042)
|
||||
6. `g-index` (0.036)
|
||||
7. `activities_total` (0.032)
|
||||
8. `pat_citation_mean` (0.024)
|
||||
9. `grants` (0.015)
|
||||
10. `first_publication_year` (0.013)
|
||||
|
||||
With the pre-founding fix applied, `publications` (pre-founding publication
|
||||
count) is now overwhelmingly the dominant signal, followed by citation-impact
|
||||
measures and patenting recency. This is a notably cleaner, more concentrated
|
||||
importance profile than before the fix (previously the top feature accounted
|
||||
for ~0.055 importance with a long, flat tail) — consistent with the ablation
|
||||
finding that the pre-founding restriction sharpens rather than removes signal.
|
||||
|
||||
|
||||
|
||||
## RQ2 — Time-to-founding prediction from a truncated profile
|
||||
|
||||
**Data**: curated 13-column half-profile founder datasets at offsets 1/2/3
|
||||
years before founding (`evaluation/datasets_halfprofiles_offset{1,2,3}`),
|
||||
paired with non-founders from `datasets_complete` using the *same* curated
|
||||
columns (legitimate/non-degenerate for non-founders too). Non-founders per
|
||||
institution are split 70/30 once (fixed seed) into a training pool (offsets
|
||||
1-3) and a holdout pool reserved exclusively for horizon-validation, so no
|
||||
individual is ever seen in both training and generalization testing.
|
||||
|
||||
### Per-offset comparison (`results/rq2/rq2_offset_comparison.csv`)
|
||||
|
||||
PR-AUC by model × offset (years before founding):
|
||||
|
||||
| model | offset=1 | offset=2 | offset=3 |
|
||||
|---|---|---|---|
|
||||
| lightgbm | 0.906 | 0.908 | **0.915** |
|
||||
| xgboost | 0.908 | **0.910** | 0.914 |
|
||||
| random_forest | 0.905 | 0.906 | 0.910 |
|
||||
| decision_tree | 0.843 | 0.844 | 0.860 |
|
||||
| logistic_regression | 0.829 | 0.830 | 0.837 |
|
||||
| dummy_most_frequent | 0.434 | 0.434 | 0.434 |
|
||||
|
||||
Predictive power increases (modestly) the closer the profile snapshot is to
|
||||
the actual founding event, as expected, and gradient-boosted trees clearly
|
||||
beat the linear/dummy baselines at every horizon.
|
||||
|
||||
### Pooled multi-horizon model + extrapolation validation
|
||||
|
||||
A single LightGBM model is trained on offsets 1-3 pooled (with `offset` as an
|
||||
explicit feature) and evaluated on:
|
||||
- its own held-out test split (in-distribution): **ROC-AUC 0.954, PR-AUC 0.947**
|
||||
- `datasets_halfprofiles_validation_offset3` — an **in-range** horizon never
|
||||
used for training these specific rows: **ROC-AUC 0.949, PR-AUC 0.945**
|
||||
- `datasets_halfprofiles_validation_offset5` — an **extrapolation** horizon
|
||||
(offset=5 was never seen during training at all): **ROC-AUC 0.942, PR-AUC 0.941**
|
||||
|
||||
(`results/rq2/rq2_horizon_validation.csv`.) The degradation from in-range to
|
||||
extrapolation is small (ROC-AUC 0.949 → 0.942), but note the caveat: tree
|
||||
ensembles cannot truly extrapolate a numeric feature (`offset`) beyond the
|
||||
range seen in training, so this result should be read as "still works
|
||||
reasonably at a nearby unseen horizon," not proof of extrapolation to
|
||||
arbitrarily distant horizons.
|
||||
|
||||
### Survival analysis (CoxPH) as a complementary framing
|
||||
|
||||
Fixed-horizon classification requires picking specific offsets in advance.
|
||||
As a principled alternative, `src/survival.py` fits a Cox proportional-hazards
|
||||
model where the event is "founded a company" and the duration is years from
|
||||
first publication to founding (or to last observed publication, censored, for
|
||||
non-founders). Covariates are full-career aggregates (a simplification since
|
||||
they are not truly time-varying — see the docstring in `survival.py` for this
|
||||
known limitation).
|
||||
|
||||
- **Concordance index (held-out): 0.715** — the model ranks who-founds-sooner
|
||||
meaningfully better than chance, but well below the classifiers above.
|
||||
- **P(founds within 5y) AUC on eligible held-out rows: 0.656** (landmark
|
||||
analysis avoiding immortal-time bias), versus the pooled classifier's
|
||||
extrapolation ROC-AUC of 0.942 at the same horizon.
|
||||
|
||||
The purpose-built fixed-horizon classifier substantially outperforms CoxPH
|
||||
here, most likely because: (a) the classifier gets to use the curated,
|
||||
horizon-specific half-profile features directly, while CoxPH's covariates are
|
||||
full-career aggregates rather than genuinely time-varying; and (b) CoxPH's
|
||||
proportional-hazards assumption is a real constraint the classifiers don't
|
||||
need to satisfy. The full `cph.print_summary()` (coefficients, hazard ratios,
|
||||
p-values) is captured in the run log and shows `pub_citation_sum`,
|
||||
`patents`/`pat_citation_sum`, and `affiliations` as the strongest positive
|
||||
hazard-ratio covariates, consistent with the RQ1 permutation-importance
|
||||
findings.
|
||||
|
||||
## Robustness & foolproofing checks (RQ1)
|
||||
|
||||
Beyond a single train/test split, `run_rq1_robustness.py` runs a battery of
|
||||
checks aimed at making the RQ1 result trustworthy rather than a lucky split,
|
||||
and at answering two specific questions: *does the pre-founding-leakage fix
|
||||
actually help or hurt?* and *should the model be split up by research area?*
|
||||
All numbers below come from actual executed runs; results are saved under
|
||||
`results/rq1_robustness/`.
|
||||
|
||||
### Ablation: does the pre-founding fix help or hurt?
|
||||
|
||||
An earlier audit found that the raw full-career activity totals technically
|
||||
include activity *after* founding (reverse causation — the model could partly
|
||||
"see the future"). The fix restricts these aggregates to pre-founding
|
||||
activity only. Comparing the two directly (`ablation_prefounding_fix.csv`):
|
||||
|
||||
| variant | n | roc_auc | pr_auc |
|
||||
|---|---|---|---|
|
||||
| fix ON (pre-founding only) | 16,494 | **0.976** | **0.969** |
|
||||
| fix OFF (raw lifetime totals) | 16,466 | 0.918 | 0.886 |
|
||||
|
||||
~~The fix *improves* performance, which is counter to the naive expectation
|
||||
that "removing a leak should hurt." The interpretation: the raw lifetime
|
||||
totals aren't a source of illegitimately-helpful signal here so much as
|
||||
*noise* — removing that dilution helps.~~
|
||||
|
||||
**Superseded (2026-08):** that interpretation was wrong. The +6-point jump is
|
||||
the tell, not noise removal: truncating one class's observation window and not
|
||||
the other's makes "small totals" a class marker, which a production probe
|
||||
confirmed (P(founder) strictly decreasing in publications, at every threshold).
|
||||
The honest comparison requires truncating *both* classes at a matched index
|
||||
date — see the redesign note at the top and `run_rq1_symmetric.py`, which
|
||||
lands at ROC-AUC ≈0.91 with a domain-plausible (hump-shaped) relationship
|
||||
between output and founding probability.
|
||||
|
||||
### 5-fold cross-validation with 95% confidence intervals
|
||||
|
||||
(`cv_summary_mean.csv`; per-fold detail in `cv_<model>.csv`.)
|
||||
|
||||
| model | pr_auc (95% CI) | roc_auc (95% CI) |
|
||||
|---|---|---|
|
||||
| lightgbm | 0.970 [0.967, 0.973] | 0.978 [0.976, 0.980] |
|
||||
| xgboost | 0.968 [0.965, 0.972] | 0.977 [0.974, 0.980] |
|
||||
| random_forest | 0.936 [0.930, 0.942] | 0.953 [0.947, 0.958] |
|
||||
| logistic_regression | 0.923 [0.917, 0.928] | 0.942 [0.936, 0.947] |
|
||||
| dummy_most_frequent | 0.368 [0.368, 0.369] | 0.500 |
|
||||
|
||||
Tight confidence intervals across folds confirm the held-out results above
|
||||
aren't an artifact of one lucky split.
|
||||
|
||||
### Hyperparameter tuning (RandomizedSearchCV)
|
||||
|
||||
(`tuning_comparison.csv`, `tuning_best_params.json`.) 20-iteration randomized
|
||||
search, 3-fold CV, optimizing PR-AUC:
|
||||
|
||||
| model | pr_auc default → tuned | roc_auc default → tuned |
|
||||
|---|---|---|
|
||||
| random_forest | 0.935 → **0.953** | 0.952 → 0.965 |
|
||||
| xgboost | 0.967 → **0.971** | 0.974 → 0.978 |
|
||||
| lightgbm | 0.969 → **0.971** | 0.976 → 0.978 |
|
||||
|
||||
Tuning gives a modest but consistent lift for every model, largest for
|
||||
random_forest. The tuned LightGBM is used as the reference model for the
|
||||
calibration and bootstrap analyses below.
|
||||
|
||||
### Calibration (`plots/calibration.png`)
|
||||
|
||||
Reliability diagrams (predicted probability vs. observed founder rate, in
|
||||
quantile bins) for logistic regression and both default/tuned LightGBM all
|
||||
track close to the diagonal — the model's probability outputs are
|
||||
meaningfully interpretable as probabilities, not just a ranking score.
|
||||
LightGBM is slightly better calibrated than logistic regression in the
|
||||
low-probability region.
|
||||
|
||||
### Bootstrap confidence intervals (tuned LightGBM, 1000 resamples)
|
||||
|
||||
(`bootstrap_ci.csv`.) Percentile bootstrap on the held-out test set:
|
||||
|
||||
| metric | estimate | 95% CI |
|
||||
|---|---|---|
|
||||
| accuracy | 0.937 | [0.929, 0.945] |
|
||||
| precision | 0.926 | [0.911, 0.941] |
|
||||
| recall | 0.900 | [0.883, 0.916] |
|
||||
| f1 | 0.913 | [0.901, 0.924] |
|
||||
| roc_auc | 0.978 | [0.973, 0.982] |
|
||||
| pr_auc | 0.971 | [0.965, 0.976] |
|
||||
| mcc | 0.863 | [0.845, 0.881] |
|
||||
|
||||
### Does research area affect the results? (stratified evaluation + per-area specialists)
|
||||
|
||||
This was a specific concern raised: founders in different research areas
|
||||
might look systematically different, and pooling everyone together could hide
|
||||
or distort area-specific effects. Two checks were run.
|
||||
|
||||
**1. Stratified evaluation** — the pooled tuned model's held-out predictions
|
||||
were broken out by broad (2-digit) research area (`area_stratified_pooled_model.csv`,
|
||||
22 groups, N from 7 to 1,166). The model performs well **uniformly** across
|
||||
areas — no area catastrophically fails. Largest groups: area "32" (N=1,166)
|
||||
roc_auc=0.967/pr_auc=0.936; area "31" (N=377) roc_auc=0.973/pr_auc=0.936; area
|
||||
"40" (N=244) roc_auc=0.962/pr_auc=0.964. Smaller areas (N<100) show more
|
||||
variance (expected from smaller sample sizes) but generally still PR-AUC
|
||||
0.91-1.0.
|
||||
|
||||
**2. Per-area specialist vs. pooled model** — for each of the 7 largest
|
||||
research areas (N≥500), a dedicated model trained *only* on that area's data
|
||||
was compared against the pooled model evaluated on the same area's subset
|
||||
(`per_area_specialist_vs_pooled.csv`):
|
||||
|
||||
| area | N (specialist train) | specialist pr_auc | pooled pr_auc |
|
||||
|---|---|---|---|
|
||||
| 32 | 4,721 | 0.929 | **0.936** |
|
||||
| 40 | 1,847 | 0.933 | **0.964** |
|
||||
| 51 | 1,012 | 0.848 | **0.941** |
|
||||
| 34 | 462 | 0.909 | **0.965** |
|
||||
|
||||
**The pooled model beats the dedicated specialist on every single area
|
||||
tested.** Splitting the model by research area hurts performance — the loss
|
||||
of training data per specialist (hundreds to a few thousand rows, vs. ~13k
|
||||
for the pooled model) outweighs any benefit from area-specific
|
||||
specialization. **Conclusion: keep research area as a pooled feature, don't
|
||||
split the model by area.**
|
||||
|
||||
## Sequence modeling — can a transformer predict *when* someone will found a company?
|
||||
|
||||
The activity-count aggregates used in RQ1/RQ2 discard *order* — e.g. two
|
||||
founders with the same total pre-founding publication count look identical
|
||||
even if one had a burst of activity right before founding and the other had
|
||||
a burst 15 years earlier. To test whether sequence order carries additional
|
||||
signal, `run_sequence_founders.py` builds true year-by-year sequences and
|
||||
compares an LSTM and a Transformer against simpler baselines on the task of
|
||||
predicting **founding_age** (years from first publication to founding) from
|
||||
the preceding 20-year window of publication/patent/grant activity.
|
||||
|
||||
### Data construction and a data-quality fix
|
||||
|
||||
`founding_age = founded_on − first_publication_year` computed naively across
|
||||
all 6,158 founders gave an absurd range (**−2,022 to +2,022**), revealing
|
||||
that a meaningful subset of founders have sentinel/placeholder year values
|
||||
(not just non-founders, as previously found). Fix: restrict to founders where
|
||||
*both* `founded_on` and `first_publication_year` fall in a plausible
|
||||
`[1950, 2024]` range (drops 1,741/6,158 implausible founders → 4,417 remain),
|
||||
then further restrict to `founding_age` in `[1, 20]` since the 20-year
|
||||
lookback window structurally can't resolve longer careers — this is a
|
||||
deliberate, documented scoping decision, not a hidden limitation. **2,298
|
||||
founders** remain for the sequence task (`src/sequence_data.py`).
|
||||
|
||||
### Results (`results/sequence_founders/`)
|
||||
|
||||
| model | mae | rmse | r2 |
|
||||
|---|---|---|---|
|
||||
| transformer | **0.180** | 0.269 | 0.998 |
|
||||
| lstm | 0.208 | **0.258** | 0.998 |
|
||||
| naive_first_activity (heuristic) | 0.554 | 1.885 | 0.888 |
|
||||
| aggregate_rf (summary stats, no order) | 2.571 | 3.424 | 0.630 |
|
||||
|
||||
(`naive_first_activity` is a zero-parameter heuristic: founding_age is
|
||||
inferred purely from how many leading zero-activity years precede the first
|
||||
nonzero year. `aggregate_rf` is a random forest on 9 summary features — total,
|
||||
nonzero-year count, and last-3-years sum per channel — deliberately
|
||||
*discarding* order, to isolate the value of order/position information.)
|
||||
|
||||
**Honest interpretation**: the task has strong structural determinism — even
|
||||
the naive heuristic gets R²=0.888 just by counting leading zero years, so
|
||||
this isn't a "hard AI problem" in the sense of needing deep learning to make
|
||||
it tractable at all. The meaningful findings are: (1) the LSTM/Transformer
|
||||
are far more **robust** than the brittle heuristic (~3x lower MAE, 0.55 → 0.18–0.21
|
||||
— the heuristic breaks badly on a single spurious early activity blip, the
|
||||
sequence models don't), and (2) sequence models vastly outperform the
|
||||
non-positional aggregate-stats baseline (R² 0.63 → 0.998), proving that
|
||||
**order/position information, not just totals, is what the extra modeling
|
||||
power is capturing.** This is reported as a robustness/precision gain over
|
||||
simpler methods, not an overclaimed "novel predictive capability."
|
||||
|
||||
### Why there's no founder-vs-non-founder sequence classifier
|
||||
|
||||
The natural next step — building comparable sequences for non-founders too,
|
||||
to train a founder-vs-non-founder *sequence* classifier (a more direct test
|
||||
of the "sequential transformer" idea) — was investigated and found **not
|
||||
feasible with the data available in this workspace**, for two independent,
|
||||
confirmed reasons:
|
||||
|
||||
1. Non-founders' `hist_{pub,pat,grant}_FN[+-]N` columns in
|
||||
`evaluation/datasets_complete` are computed by
|
||||
`extraction/non_founders_scripts.ipynb`'s `generate_history(...,
|
||||
nonstartup=True)`, which hardcodes `founded_year = 0` for non-founders —
|
||||
these columns are anchored at literal calendar year 0 and are **entirely
|
||||
zero** (verified via `.sum()==0` / `.max()==0` across every non-founder row).
|
||||
They were never usable for this and are correctly excluded from
|
||||
`config.RQ1_NUMERIC_COLUMNS` already (no leakage risk in the existing RQ1
|
||||
model).
|
||||
2. As a fallback, the raw `dimensions_data/{institution}_papers.csv` files
|
||||
were checked directly for a possible reconstruction path. These files
|
||||
turn out to contain **only founders' publication records** — verified on
|
||||
Stanford by matching tracked researcher names against the raw file's
|
||||
`author_people` column: **85.8%** of founders (1,580/1,842) match, versus
|
||||
**0%** of non-founders (0/2,482). No raw non-founder paper/patent pull
|
||||
files exist anywhere in the workspace (only pre-aggregated
|
||||
`*_nonfounders_features_dataset.csv` summaries) — the underlying raw data
|
||||
would need to be re-collected from the Dimensions API, which is out of
|
||||
scope here.
|
||||
|
||||
Given this, the founder-only founding-age sequence model above is the
|
||||
deliverable for the "sequential transformer" investigation. Building a
|
||||
founder-vs-non-founder sequence classifier would require re-querying the
|
||||
Dimensions API for non-founders' raw, per-year publication/patent history.
|
||||
|
||||
(Side note for any future data-collection work: `dimensions_data/*_papers.csv`
|
||||
already has a pre-matched flat `author_people` name column + numeric `year`
|
||||
column, exploded to one row per paper per tracked founder — reconstructing a
|
||||
person's per-year totals is a simple `groupby(["author_people","year"]).size()`
|
||||
away, no need to fuzzy-match the nested `authors` JSON-like list yourself.
|
||||
Loading just `usecols=["author_people","year"]` is fast — about 10s even for
|
||||
a 4.4GB/600K-row file — and reproduces `datasets_complete`'s `publications`
|
||||
totals almost exactly, 98.1% exact match, correlation 0.99999997, for the
|
||||
founders whose names do match.)
|
||||
|
||||
## Answering the research questions
|
||||
|
||||
- **RQ1**: Yes. LightGBM classifies founders vs. non-founders with ROC-AUC
|
||||
0.976 / PR-AUC 0.969 on held-out data, a statistically significant
|
||||
improvement (McNemar p≈5.4e-20) over the best simple baseline (logistic
|
||||
regression, ROC-AUC 0.943), and generalizes well to institutions unseen
|
||||
during training (mean ROC-AUC 0.95 under leave-one-institution-out).
|
||||
- **RQ2**: Yes, with caveats. Gradient-boosted models predict founding within
|
||||
a 1-3 year horizon from truncated profiles with ROC-AUC ≈ 0.91-0.92, and a
|
||||
pooled multi-horizon model still achieves ROC-AUC 0.94 at a 5-year horizon
|
||||
it never trained on directly (small degradation vs. 0.95 in-distribution).
|
||||
A CoxPH survival model provides a complementary, assumption-explicit
|
||||
time-to-event view but underperforms the direct classifier (concordance
|
||||
0.715, 5-year AUC 0.656), which is expected given it uses less
|
||||
horizon-specific information.
|
||||
- **Is this robust, or a lucky split?** The RQ1 result holds up under 5-fold
|
||||
CV (tight 95% CIs), bootstrap resampling, hyperparameter tuning, and
|
||||
calibration checks — see "Robustness & foolproofing checks" above. The
|
||||
pre-founding leakage fix specifically *improves* performance rather than
|
||||
degrading it (0.976 vs 0.918 ROC-AUC), and the model performs uniformly
|
||||
well across all 22 research-area groups, with a pooled model beating
|
||||
every dedicated per-area specialist tested.
|
||||
- **Does sequence order (not just totals) matter?** Yes. LSTM/Transformer
|
||||
models predicting founding_age from ordered 20-year activity sequences
|
||||
achieve R²=0.998, versus R²=0.63 for an equivalent non-positional
|
||||
aggregate-stats model — see "Sequence modeling" above. A comparable
|
||||
founder-vs-non-founder sequence classifier was investigated but found
|
||||
infeasible with data available in this workspace (non-founders lack any
|
||||
usable raw or pre-aggregated sequence data).
|
||||
@@ -1,404 +0,0 @@
|
||||
{
|
||||
"meta":{"test_sets":[],"test_metrics":[],"learn_metrics":[{"best_value":"Min","name":"Logloss"}],"launch_mode":"Train","parameters":"","iteration_count":400,"learn_sets":["learn"],"name":"experiment"},
|
||||
"iterations":[
|
||||
{"learn":[0.6752574527],"iteration":0,"passed_time":0.001151431995,"remaining_time":0.4594213658},
|
||||
{"learn":[0.6590158329],"iteration":1,"passed_time":0.002307072378,"remaining_time":0.4591074033},
|
||||
{"learn":[0.6439053461],"iteration":2,"passed_time":0.003364919794,"remaining_time":0.4452910527},
|
||||
{"learn":[0.6300318652],"iteration":3,"passed_time":0.00447839295,"remaining_time":0.443360902},
|
||||
{"learn":[0.6176080869],"iteration":4,"passed_time":0.005583615996,"remaining_time":0.4411056637},
|
||||
{"learn":[0.6072057723],"iteration":5,"passed_time":0.006660005325,"remaining_time":0.4373403497},
|
||||
{"learn":[0.5978862443],"iteration":6,"passed_time":0.007736852993,"remaining_time":0.4343690323},
|
||||
{"learn":[0.5892253742],"iteration":7,"passed_time":0.008886826635,"remaining_time":0.4354545051},
|
||||
{"learn":[0.5808671388],"iteration":8,"passed_time":0.009982507887,"remaining_time":0.4336845093},
|
||||
{"learn":[0.5732077946],"iteration":9,"passed_time":0.01101731333,"remaining_time":0.4296752199},
|
||||
{"learn":[0.5661847426],"iteration":10,"passed_time":0.01213249484,"remaining_time":0.4290491358},
|
||||
{"learn":[0.5600289293],"iteration":11,"passed_time":0.01322150934,"remaining_time":0.4274954686},
|
||||
{"learn":[0.5530962469],"iteration":12,"passed_time":0.01425406475,"remaining_time":0.424332543},
|
||||
{"learn":[0.5481010119],"iteration":13,"passed_time":0.01530245371,"remaining_time":0.4219105093},
|
||||
{"learn":[0.5434953481],"iteration":14,"passed_time":0.0164163852,"remaining_time":0.4213538869},
|
||||
{"learn":[0.5404101637],"iteration":15,"passed_time":0.01755581704,"remaining_time":0.4213396089},
|
||||
{"learn":[0.5361341938],"iteration":16,"passed_time":0.01863220637,"remaining_time":0.4197726493},
|
||||
{"learn":[0.5317763411],"iteration":17,"passed_time":0.01970834569,"remaining_time":0.4182548919},
|
||||
{"learn":[0.5268163473],"iteration":18,"passed_time":0.02082269386,"remaining_time":0.4175498084},
|
||||
{"learn":[0.5245315654],"iteration":19,"passed_time":0.02184062408,"remaining_time":0.4149718575},
|
||||
{"learn":[0.5205327316],"iteration":20,"passed_time":0.02292138846,"remaining_time":0.413676487},
|
||||
{"learn":[0.5177701576],"iteration":21,"passed_time":0.02400340287,"remaining_time":0.4124221038},
|
||||
{"learn":[0.5137445796],"iteration":22,"passed_time":0.02504066668,"remaining_time":0.4104491886},
|
||||
{"learn":[0.5105456834],"iteration":23,"passed_time":0.02616559832,"remaining_time":0.409927707},
|
||||
{"learn":[0.5080257838],"iteration":24,"passed_time":0.02732961381,"remaining_time":0.4099442072},
|
||||
{"learn":[0.5054934276],"iteration":25,"passed_time":0.02844792037,"remaining_time":0.409212393},
|
||||
{"learn":[0.503296382],"iteration":26,"passed_time":0.02956914363,"remaining_time":0.4084922434},
|
||||
{"learn":[0.5006211207],"iteration":27,"passed_time":0.03064232458,"remaining_time":0.4071051694},
|
||||
{"learn":[0.4985921934],"iteration":28,"passed_time":0.03184809063,"remaining_time":0.4074359181},
|
||||
{"learn":[0.4961473489],"iteration":29,"passed_time":0.03302202292,"remaining_time":0.4072716161},
|
||||
{"learn":[0.4946219665],"iteration":30,"passed_time":0.03417528828,"remaining_time":0.4067961733},
|
||||
{"learn":[0.4925272328],"iteration":31,"passed_time":0.03534963724,"remaining_time":0.4065208283},
|
||||
{"learn":[0.4898936852],"iteration":32,"passed_time":0.03647952728,"remaining_time":0.405696561},
|
||||
{"learn":[0.4884288887],"iteration":33,"passed_time":0.03768625168,"remaining_time":0.4056814152},
|
||||
{"learn":[0.4863838977],"iteration":34,"passed_time":0.03874026571,"remaining_time":0.4040056281},
|
||||
{"learn":[0.4845515615],"iteration":35,"passed_time":0.03985815559,"remaining_time":0.4030102399},
|
||||
{"learn":[0.4824883347],"iteration":36,"passed_time":0.04112954752,"remaining_time":0.4035142094},
|
||||
{"learn":[0.4804030524],"iteration":37,"passed_time":0.04225827088,"remaining_time":0.4025656331},
|
||||
{"learn":[0.4785388461],"iteration":38,"passed_time":0.04337724411,"remaining_time":0.4015175672},
|
||||
{"learn":[0.4770942099],"iteration":39,"passed_time":0.04458921857,"remaining_time":0.4013029672},
|
||||
{"learn":[0.4756384413],"iteration":40,"passed_time":0.04566781626,"remaining_time":0.3998718546},
|
||||
{"learn":[0.4747696424],"iteration":41,"passed_time":0.04680949813,"remaining_time":0.398995246},
|
||||
{"learn":[0.4736129814],"iteration":42,"passed_time":0.04803018105,"remaining_time":0.3987622008},
|
||||
{"learn":[0.4725400991],"iteration":43,"passed_time":0.04913252905,"remaining_time":0.397526826},
|
||||
{"learn":[0.4712424271],"iteration":44,"passed_time":0.05019441819,"remaining_time":0.3959781879},
|
||||
{"learn":[0.4701835699],"iteration":45,"passed_time":0.05135301695,"remaining_time":0.3951949565},
|
||||
{"learn":[0.4690223311],"iteration":46,"passed_time":0.05250178224,"remaining_time":0.3943218964},
|
||||
{"learn":[0.4682401998],"iteration":47,"passed_time":0.05360408858,"remaining_time":0.3930966496},
|
||||
{"learn":[0.4663252757],"iteration":48,"passed_time":0.05468322794,"remaining_time":0.3917104696},
|
||||
{"learn":[0.4651951732],"iteration":49,"passed_time":0.05579611776,"remaining_time":0.3905728243},
|
||||
{"learn":[0.4643129126],"iteration":50,"passed_time":0.05688575727,"remaining_time":0.3892770448},
|
||||
{"learn":[0.4634919617],"iteration":51,"passed_time":0.05797056337,"remaining_time":0.3879568472},
|
||||
{"learn":[0.4627711631],"iteration":52,"passed_time":0.05911424526,"remaining_time":0.387031002},
|
||||
{"learn":[0.4618109601],"iteration":53,"passed_time":0.06020113473,"remaining_time":0.3857331966},
|
||||
{"learn":[0.460959898],"iteration":54,"passed_time":0.06127473236,"remaining_time":0.3843596848},
|
||||
{"learn":[0.4594625002],"iteration":55,"passed_time":0.06230199603,"remaining_time":0.3827122613},
|
||||
{"learn":[0.4584854101],"iteration":56,"passed_time":0.06340980245,"remaining_time":0.3815712674},
|
||||
{"learn":[0.4570498581],"iteration":57,"passed_time":0.06447248326,"remaining_time":0.3801653323},
|
||||
{"learn":[0.455880592],"iteration":58,"passed_time":0.0655374141,"remaining_time":0.3787840374},
|
||||
{"learn":[0.4550663099],"iteration":59,"passed_time":0.06660280329,"remaining_time":0.3774158853},
|
||||
{"learn":[0.4542687957],"iteration":60,"passed_time":0.06766948415,"remaining_time":0.3760648382},
|
||||
{"learn":[0.4535032807],"iteration":61,"passed_time":0.06875341525,"remaining_time":0.3748170057},
|
||||
{"learn":[0.4526542794],"iteration":62,"passed_time":0.06989509711,"remaining_time":0.3738832973},
|
||||
{"learn":[0.4514785115],"iteration":63,"passed_time":0.07101169531,"remaining_time":0.3728114004},
|
||||
{"learn":[0.4507802979],"iteration":64,"passed_time":0.07211233496,"remaining_time":0.3716558802},
|
||||
{"learn":[0.4491962574],"iteration":65,"passed_time":0.07314830709,"remaining_time":0.3701747662},
|
||||
{"learn":[0.4485895185],"iteration":66,"passed_time":0.07426457195,"remaining_time":0.3691060068},
|
||||
{"learn":[0.4478692379],"iteration":67,"passed_time":0.07539092027,"remaining_time":0.3680850813},
|
||||
{"learn":[0.4463417221],"iteration":68,"passed_time":0.07652310201,"remaining_time":0.3670890836},
|
||||
{"learn":[0.4452451739],"iteration":69,"passed_time":0.07766007548,"remaining_time":0.3661117844},
|
||||
{"learn":[0.4444830618],"iteration":70,"passed_time":0.07871713122,"remaining_time":0.3647596644},
|
||||
{"learn":[0.4435724065],"iteration":71,"passed_time":0.07978656212,"remaining_time":0.3634721163},
|
||||
{"learn":[0.4420487712],"iteration":72,"passed_time":0.08081545082,"remaining_time":0.3620089372},
|
||||
{"learn":[0.441478802],"iteration":73,"passed_time":0.08198309136,"remaining_time":0.3611687538},
|
||||
{"learn":[0.4410124289],"iteration":74,"passed_time":0.08309781453,"remaining_time":0.3600905296},
|
||||
{"learn":[0.4401138277],"iteration":75,"passed_time":0.08419895419,"remaining_time":0.3589534363},
|
||||
{"learn":[0.4394535191],"iteration":76,"passed_time":0.08528813536,"remaining_time":0.3577671133},
|
||||
{"learn":[0.4388369011],"iteration":77,"passed_time":0.08643506729,"remaining_time":0.3568216881},
|
||||
{"learn":[0.4379911776],"iteration":78,"passed_time":0.08757429079,"remaining_time":0.3558398398},
|
||||
{"learn":[0.4374327656],"iteration":79,"passed_time":0.08871480597,"remaining_time":0.3548592239},
|
||||
{"learn":[0.4364149666],"iteration":80,"passed_time":0.08976015322,"remaining_time":0.3534998627},
|
||||
{"learn":[0.4358972456],"iteration":81,"passed_time":0.09086350124,"remaining_time":0.3523730902},
|
||||
{"learn":[0.4352582245],"iteration":82,"passed_time":0.09194689067,"remaining_time":0.3511706547},
|
||||
{"learn":[0.4345396736],"iteration":83,"passed_time":0.09300957148,"remaining_time":0.3498931499},
|
||||
{"learn":[0.4341003864],"iteration":84,"passed_time":0.09409496093,"remaining_time":0.3487048552},
|
||||
{"learn":[0.4332298157],"iteration":85,"passed_time":0.09523405943,"remaining_time":0.3477150542},
|
||||
{"learn":[0.43230384],"iteration":86,"passed_time":0.09630836539,"remaining_time":0.3464887169},
|
||||
{"learn":[0.4316562364],"iteration":87,"passed_time":0.09744271383,"remaining_time":0.3454787127},
|
||||
{"learn":[0.4309618622],"iteration":88,"passed_time":0.09848635272,"remaining_time":0.3441489404},
|
||||
{"learn":[0.4298558624],"iteration":89,"passed_time":0.09950936634,"remaining_time":0.3427544841},
|
||||
{"learn":[0.4291876524],"iteration":90,"passed_time":0.100633923,"remaining_time":0.3417129912},
|
||||
{"learn":[0.4282528408],"iteration":91,"passed_time":0.1017303959,"remaining_time":0.3405756732},
|
||||
{"learn":[0.4277131957],"iteration":92,"passed_time":0.10278841,"remaining_time":0.3393122781},
|
||||
{"learn":[0.4271829294],"iteration":93,"passed_time":0.1038367156,"remaining_time":0.3380216487},
|
||||
{"learn":[0.4264580876],"iteration":94,"passed_time":0.1049022298,"remaining_time":0.3367913693},
|
||||
{"learn":[0.4253379692],"iteration":95,"passed_time":0.1059805358,"remaining_time":0.3356050301},
|
||||
{"learn":[0.424511763],"iteration":96,"passed_time":0.107145843,"remaining_time":0.3346926848},
|
||||
{"learn":[0.4239388347],"iteration":97,"passed_time":0.1083300671,"remaining_time":0.3338334721},
|
||||
{"learn":[0.4232630534],"iteration":98,"passed_time":0.1094859575,"remaining_time":0.3328815475},
|
||||
{"learn":[0.4226485557],"iteration":99,"passed_time":0.1106647232,"remaining_time":0.3319941695},
|
||||
{"learn":[0.4222437514],"iteration":100,"passed_time":0.1117923632,"remaining_time":0.3309496692},
|
||||
{"learn":[0.4213299083],"iteration":101,"passed_time":0.1128746276,"remaining_time":0.3297709708},
|
||||
{"learn":[0.4208753627],"iteration":102,"passed_time":0.1139770589,"remaining_time":0.3286522961},
|
||||
{"learn":[0.420347864],"iteration":103,"passed_time":0.1151212408,"remaining_time":0.3276527624},
|
||||
{"learn":[0.4191908122],"iteration":104,"passed_time":0.1161755049,"remaining_time":0.326397847},
|
||||
{"learn":[0.4183297442],"iteration":105,"passed_time":0.1172568109,"remaining_time":0.3252217209},
|
||||
{"learn":[0.417987752],"iteration":106,"passed_time":0.1184834106,"remaining_time":0.3244452271},
|
||||
{"learn":[0.4174588649],"iteration":107,"passed_time":0.1196537595,"remaining_time":0.3235083127},
|
||||
{"learn":[0.4169787866],"iteration":108,"passed_time":0.120715107,"remaining_time":0.3222761113},
|
||||
{"learn":[0.4159189441],"iteration":109,"passed_time":0.1218433303,"remaining_time":0.3212233254},
|
||||
{"learn":[0.4153188878],"iteration":110,"passed_time":0.1229131362,"remaining_time":0.3200170844},
|
||||
{"learn":[0.4148918317],"iteration":111,"passed_time":0.1240373595,"remaining_time":0.3189532102},
|
||||
{"learn":[0.4144564688],"iteration":112,"passed_time":0.1251508743,"remaining_time":0.3178610702},
|
||||
{"learn":[0.4138592532],"iteration":113,"passed_time":0.1262253053,"remaining_time":0.3166705028},
|
||||
{"learn":[0.4133895004],"iteration":114,"passed_time":0.1273423202,"remaining_time":0.3155874892},
|
||||
{"learn":[0.4127703464],"iteration":115,"passed_time":0.1285151691,"remaining_time":0.3146405865},
|
||||
{"learn":[0.4124298162],"iteration":116,"passed_time":0.1297458938,"remaining_time":0.3138298116},
|
||||
{"learn":[0.4120395574],"iteration":117,"passed_time":0.1308234915,"remaining_time":0.3126459713},
|
||||
{"learn":[0.4107360285],"iteration":118,"passed_time":0.1318712555,"remaining_time":0.3113934688},
|
||||
{"learn":[0.4101591941],"iteration":119,"passed_time":0.1329510198,"remaining_time":0.3102190463},
|
||||
{"learn":[0.4092665733],"iteration":120,"passed_time":0.1340602013,"remaining_time":0.3091140178},
|
||||
{"learn":[0.4088576793],"iteration":121,"passed_time":0.135163341,"remaining_time":0.307995154},
|
||||
{"learn":[0.408361342],"iteration":122,"passed_time":0.1362857726,"remaining_time":0.3069199919},
|
||||
{"learn":[0.4078673303],"iteration":123,"passed_time":0.137447538,"remaining_time":0.3059316169},
|
||||
{"learn":[0.4073910152],"iteration":124,"passed_time":0.1386097202,"remaining_time":0.3049413844},
|
||||
{"learn":[0.4066843028],"iteration":125,"passed_time":0.1397284017,"remaining_time":0.303853826},
|
||||
{"learn":[0.4062068195],"iteration":126,"passed_time":0.1408698336,"remaining_time":0.3028146817},
|
||||
{"learn":[0.4054839673],"iteration":127,"passed_time":0.1420183489,"remaining_time":0.3017889914},
|
||||
{"learn":[0.4049627816],"iteration":128,"passed_time":0.1431889478,"remaining_time":0.3008077896},
|
||||
{"learn":[0.4042386686],"iteration":129,"passed_time":0.1442632954,"remaining_time":0.2996237674},
|
||||
{"learn":[0.4036896032],"iteration":130,"passed_time":0.1453401431,"remaining_time":0.2984465534},
|
||||
{"learn":[0.4030055463],"iteration":131,"passed_time":0.1463643234,"remaining_time":0.2971639293},
|
||||
{"learn":[0.4025982201],"iteration":132,"passed_time":0.1475024636,"remaining_time":0.2961139682},
|
||||
{"learn":[0.4021507256],"iteration":133,"passed_time":0.148610145,"remaining_time":0.2950022281},
|
||||
{"learn":[0.4017130107],"iteration":134,"passed_time":0.1497692437,"remaining_time":0.2939914784},
|
||||
{"learn":[0.4010693391],"iteration":135,"passed_time":0.1509060922,"remaining_time":0.2929353554},
|
||||
{"learn":[0.400549588],"iteration":136,"passed_time":0.1520051485,"remaining_time":0.2918055041},
|
||||
{"learn":[0.3999916469],"iteration":137,"passed_time":0.1530488291,"remaining_time":0.2905709653},
|
||||
{"learn":[0.3996655064],"iteration":138,"passed_time":0.1542111362,"remaining_time":0.2895619176},
|
||||
{"learn":[0.3993175997],"iteration":139,"passed_time":0.1553874019,"remaining_time":0.2885766034},
|
||||
{"learn":[0.3989923873],"iteration":140,"passed_time":0.1565616258,"remaining_time":0.2875848304},
|
||||
{"learn":[0.3985453884],"iteration":141,"passed_time":0.1576826824,"remaining_time":0.2864938878},
|
||||
{"learn":[0.3980582085],"iteration":142,"passed_time":0.1588619064,"remaining_time":0.2855070626},
|
||||
{"learn":[0.3978472172],"iteration":143,"passed_time":0.1599966715,"remaining_time":0.2844385272},
|
||||
{"learn":[0.3973697391],"iteration":144,"passed_time":0.1611236449,"remaining_time":0.2833553755},
|
||||
{"learn":[0.3970929708],"iteration":145,"passed_time":0.1622325346,"remaining_time":0.282240163},
|
||||
{"learn":[0.3966356443],"iteration":146,"passed_time":0.1633921751,"remaining_time":0.281212383},
|
||||
{"learn":[0.3962418114],"iteration":147,"passed_time":0.1644628977,"remaining_time":0.2800314204},
|
||||
{"learn":[0.3958183212],"iteration":148,"passed_time":0.1656396633,"remaining_time":0.2790305738},
|
||||
{"learn":[0.3952962072],"iteration":149,"passed_time":0.1667435114,"remaining_time":0.2779058523},
|
||||
{"learn":[0.3947786724],"iteration":150,"passed_time":0.1677856502,"remaining_time":0.2766796484},
|
||||
{"learn":[0.3942251128],"iteration":151,"passed_time":0.1688929983,"remaining_time":0.2755622604},
|
||||
{"learn":[0.393510771],"iteration":152,"passed_time":0.1706222297,"remaining_time":0.275448959},
|
||||
{"learn":[0.3931935538],"iteration":153,"passed_time":0.1716946189,"remaining_time":0.2742654303},
|
||||
{"learn":[0.3929263145],"iteration":154,"passed_time":0.1728882598,"remaining_time":0.2732749913},
|
||||
{"learn":[0.3921994504],"iteration":155,"passed_time":0.1739467323,"remaining_time":0.2720705299},
|
||||
{"learn":[0.3918641893],"iteration":156,"passed_time":0.1750668305,"remaining_time":0.2709633109},
|
||||
{"learn":[0.391568347],"iteration":157,"passed_time":0.1762223459,"remaining_time":0.2699101753},
|
||||
{"learn":[0.3907576665],"iteration":158,"passed_time":0.1772855684,"remaining_time":0.2687158615},
|
||||
{"learn":[0.3900011029],"iteration":159,"passed_time":0.1783590827,"remaining_time":0.267538624},
|
||||
{"learn":[0.3896939448],"iteration":160,"passed_time":0.1793802212,"remaining_time":0.2662849247},
|
||||
{"learn":[0.3892669751],"iteration":161,"passed_time":0.1805231531,"remaining_time":0.2652130274},
|
||||
{"learn":[0.3887156987],"iteration":162,"passed_time":0.1816665017,"remaining_time":0.2641408644},
|
||||
{"learn":[0.3882799657],"iteration":163,"passed_time":0.1828028501,"remaining_time":0.26305776},
|
||||
{"learn":[0.3878736136],"iteration":164,"passed_time":0.1839560322,"remaining_time":0.2619979852},
|
||||
{"learn":[0.3873377012],"iteration":165,"passed_time":0.1850520051,"remaining_time":0.2608564409},
|
||||
{"learn":[0.3868683205],"iteration":166,"passed_time":0.1861906452,"remaining_time":0.2597749721},
|
||||
{"learn":[0.3863639324],"iteration":167,"passed_time":0.1872421176,"remaining_time":0.2585724481},
|
||||
{"learn":[0.3856756608],"iteration":168,"passed_time":0.1883451739,"remaining_time":0.25744222},
|
||||
{"learn":[0.3851101196],"iteration":169,"passed_time":0.1894709389,"remaining_time":0.256343035},
|
||||
{"learn":[0.3845899076],"iteration":170,"passed_time":0.1905734536,"remaining_time":0.2552124028},
|
||||
{"learn":[0.3842809463],"iteration":171,"passed_time":0.1917395108,"remaining_time":0.2541663282},
|
||||
{"learn":[0.3838979772],"iteration":172,"passed_time":0.1928156501,"remaining_time":0.2530008819},
|
||||
{"learn":[0.3835421864],"iteration":173,"passed_time":0.1939655821,"remaining_time":0.2519323078},
|
||||
{"learn":[0.3831593151],"iteration":174,"passed_time":0.1951238058,"remaining_time":0.2508734646},
|
||||
{"learn":[0.3824219971],"iteration":175,"passed_time":0.1961889867,"remaining_time":0.2496950739},
|
||||
{"learn":[0.3818750513],"iteration":176,"passed_time":0.1972604593,"remaining_time":0.2485258894},
|
||||
{"learn":[0.3814587697],"iteration":177,"passed_time":0.1984253498,"remaining_time":0.2474743126},
|
||||
{"learn":[0.3811315933],"iteration":178,"passed_time":0.1995047391,"remaining_time":0.246315907},
|
||||
{"learn":[0.3806289168],"iteration":179,"passed_time":0.2005956703,"remaining_time":0.245172486},
|
||||
{"learn":[0.3801948808],"iteration":180,"passed_time":0.2016544344,"remaining_time":0.2439907245},
|
||||
{"learn":[0.3793927537],"iteration":181,"passed_time":0.2026815314,"remaining_time":0.2427723838},
|
||||
{"learn":[0.379061847],"iteration":182,"passed_time":0.2039010477,"remaining_time":0.2417843024},
|
||||
{"learn":[0.3786859738],"iteration":183,"passed_time":0.2050741883,"remaining_time":0.2407392645},
|
||||
{"learn":[0.3783497847],"iteration":184,"passed_time":0.2063676222,"remaining_time":0.239832642},
|
||||
{"learn":[0.3780392163],"iteration":185,"passed_time":0.2075032623,"remaining_time":0.2387403125},
|
||||
{"learn":[0.3773187067],"iteration":186,"passed_time":0.2086255689,"remaining_time":0.2376323325},
|
||||
{"learn":[0.3768762307],"iteration":187,"passed_time":0.2097723758,"remaining_time":0.2365518281},
|
||||
{"learn":[0.3763556852],"iteration":188,"passed_time":0.2108025562,"remaining_time":0.2353404199},
|
||||
{"learn":[0.3756938863],"iteration":189,"passed_time":0.2118649037,"remaining_time":0.2341664725},
|
||||
{"learn":[0.3752401881],"iteration":190,"passed_time":0.2130044189,"remaining_time":0.2330781337},
|
||||
{"learn":[0.3747042165],"iteration":191,"passed_time":0.2140860166,"remaining_time":0.231926518},
|
||||
{"learn":[0.3741421572],"iteration":192,"passed_time":0.2152354486,"remaining_time":0.2308483826},
|
||||
{"learn":[0.3737531083],"iteration":193,"passed_time":0.2163026711,"remaining_time":0.2296822178},
|
||||
{"learn":[0.3729714636],"iteration":194,"passed_time":0.2173279764,"remaining_time":0.2284730008},
|
||||
{"learn":[0.3723401504],"iteration":195,"passed_time":0.2184194909,"remaining_time":0.2273345722},
|
||||
{"learn":[0.3717195748],"iteration":196,"passed_time":0.2195059221,"remaining_time":0.2261913816},
|
||||
{"learn":[0.3713120882],"iteration":197,"passed_time":0.220651104,"remaining_time":0.225108702},
|
||||
{"learn":[0.3706316865],"iteration":198,"passed_time":0.2217496603,"remaining_time":0.2239783001},
|
||||
{"learn":[0.3702966116],"iteration":199,"passed_time":0.2229138841,"remaining_time":0.2229138841},
|
||||
{"learn":[0.3697721904],"iteration":200,"passed_time":0.2240036069,"remaining_time":0.2217747153},
|
||||
{"learn":[0.3690342594],"iteration":201,"passed_time":0.2250807463,"remaining_time":0.2206237018},
|
||||
{"learn":[0.3685483475],"iteration":202,"passed_time":0.2262793039,"remaining_time":0.2195912457},
|
||||
{"learn":[0.3679488892],"iteration":203,"passed_time":0.2273438597,"remaining_time":0.2184284143},
|
||||
{"learn":[0.3674652876],"iteration":204,"passed_time":0.2285949181,"remaining_time":0.2174439465},
|
||||
{"learn":[0.3661867815],"iteration":205,"passed_time":0.2296574322,"remaining_time":0.2162793294},
|
||||
{"learn":[0.3655245649],"iteration":206,"passed_time":0.2307709887,"remaining_time":0.215163289},
|
||||
{"learn":[0.3651419912],"iteration":207,"passed_time":0.2319487544,"remaining_time":0.2141065425},
|
||||
{"learn":[0.3648638467],"iteration":208,"passed_time":0.2331167699,"remaining_time":0.2130397275},
|
||||
{"learn":[0.3645890135],"iteration":209,"passed_time":0.234272952,"remaining_time":0.2119612423},
|
||||
{"learn":[0.3641188983],"iteration":210,"passed_time":0.2353604665,"remaining_time":0.2108205126},
|
||||
{"learn":[0.3636023273],"iteration":211,"passed_time":0.2365067734,"remaining_time":0.2097324217},
|
||||
{"learn":[0.3625971287],"iteration":212,"passed_time":0.237603163,"remaining_time":0.20859996},
|
||||
{"learn":[0.3620963436],"iteration":213,"passed_time":0.2387020943,"remaining_time":0.2074700446},
|
||||
{"learn":[0.3613752339],"iteration":214,"passed_time":0.239779317,"remaining_time":0.2063217378},
|
||||
{"learn":[0.3609288026],"iteration":215,"passed_time":0.2409774579,"remaining_time":0.2052770938},
|
||||
{"learn":[0.3602546044],"iteration":216,"passed_time":0.2420783892,"remaining_time":0.2041490563},
|
||||
{"learn":[0.3596176626],"iteration":217,"passed_time":0.2431287365,"remaining_time":0.2029790369},
|
||||
{"learn":[0.3591174894],"iteration":218,"passed_time":0.2443525445,"remaining_time":0.2019534728},
|
||||
{"learn":[0.3584672055],"iteration":219,"passed_time":0.2454519758,"remaining_time":0.2008243438},
|
||||
{"learn":[0.3579661615],"iteration":220,"passed_time":0.2465854492,"remaining_time":0.1997230562},
|
||||
{"learn":[0.3575125863],"iteration":221,"passed_time":0.2476947973,"remaining_time":0.1986021348},
|
||||
{"learn":[0.3570908255],"iteration":222,"passed_time":0.2488168539,"remaining_time":0.1974914042},
|
||||
{"learn":[0.3565320443],"iteration":223,"passed_time":0.2499274937,"remaining_time":0.1963716022},
|
||||
{"learn":[0.3557740348],"iteration":224,"passed_time":0.2510059664,"remaining_time":0.1952268628},
|
||||
{"learn":[0.3552039883],"iteration":225,"passed_time":0.2521369815,"remaining_time":0.1941231627},
|
||||
{"learn":[0.3546823154],"iteration":226,"passed_time":0.2532487879,"remaining_time":0.1930045829},
|
||||
{"learn":[0.3542588096],"iteration":227,"passed_time":0.2543872197,"remaining_time":0.1919061482},
|
||||
{"learn":[0.3539054745],"iteration":228,"passed_time":0.2556031526,"remaining_time":0.1908652362},
|
||||
{"learn":[0.3532278683],"iteration":229,"passed_time":0.2566931254,"remaining_time":0.1897297014},
|
||||
{"learn":[0.3529230362],"iteration":230,"passed_time":0.2578798912,"remaining_time":0.188665375},
|
||||
{"learn":[0.352381597],"iteration":231,"passed_time":0.2589980311,"remaining_time":0.1875502984},
|
||||
{"learn":[0.3518928383],"iteration":232,"passed_time":0.2601070459,"remaining_time":0.1864286552},
|
||||
{"learn":[0.3513050813],"iteration":233,"passed_time":0.2611858102,"remaining_time":0.1852856603},
|
||||
{"learn":[0.3508996451],"iteration":234,"passed_time":0.262347159,"remaining_time":0.1842011968},
|
||||
{"learn":[0.3504190546],"iteration":235,"passed_time":0.2635076745,"remaining_time":0.1831155026},
|
||||
{"learn":[0.350020568],"iteration":236,"passed_time":0.2645913556,"remaining_time":0.1819763332},
|
||||
{"learn":[0.3495522954],"iteration":237,"passed_time":0.265650578,"remaining_time":0.1808209817},
|
||||
{"learn":[0.349180171],"iteration":238,"passed_time":0.2667622178,"remaining_time":0.1797017451},
|
||||
{"learn":[0.3488403456],"iteration":239,"passed_time":0.2679780257,"remaining_time":0.1786520171},
|
||||
{"learn":[0.348326175],"iteration":240,"passed_time":0.2690999573,"remaining_time":0.177538976},
|
||||
{"learn":[0.3480609146],"iteration":241,"passed_time":0.2704532669,"remaining_time":0.1765769264},
|
||||
{"learn":[0.3474846933],"iteration":242,"passed_time":0.271532448,"remaining_time":0.1754345446},
|
||||
{"learn":[0.3470838691],"iteration":243,"passed_time":0.2727193804,"remaining_time":0.1743615711},
|
||||
{"learn":[0.3464878166],"iteration":244,"passed_time":0.2737749778,"remaining_time":0.1732045778},
|
||||
{"learn":[0.3461395179],"iteration":245,"passed_time":0.2749240348,"remaining_time":0.1721069161},
|
||||
{"learn":[0.3452807894],"iteration":246,"passed_time":0.2759993824,"remaining_time":0.1709631802},
|
||||
{"learn":[0.3449142029],"iteration":247,"passed_time":0.2772472741,"remaining_time":0.1699257486},
|
||||
{"learn":[0.3443799395],"iteration":248,"passed_time":0.2783343302,"remaining_time":0.1687890918},
|
||||
{"learn":[0.3438780899],"iteration":249,"passed_time":0.2794902206,"remaining_time":0.1676941324},
|
||||
{"learn":[0.343511803],"iteration":250,"passed_time":0.2805435263,"remaining_time":0.1665377905},
|
||||
{"learn":[0.3430115446],"iteration":251,"passed_time":0.2816808747,"remaining_time":0.1654316249},
|
||||
{"learn":[0.3424726164],"iteration":252,"passed_time":0.2828335984,"remaining_time":0.1643341461},
|
||||
{"learn":[0.3420562225],"iteration":253,"passed_time":0.2839551134,"remaining_time":0.1632182935},
|
||||
{"learn":[0.34149691],"iteration":254,"passed_time":0.285008294,"remaining_time":0.1620635397},
|
||||
{"learn":[0.3409610654],"iteration":255,"passed_time":0.2860447662,"remaining_time":0.160900181},
|
||||
{"learn":[0.3405231536],"iteration":256,"passed_time":0.2871926148,"remaining_time":0.1597997818},
|
||||
{"learn":[0.340034093],"iteration":257,"passed_time":0.2882568373,"remaining_time":0.158652988},
|
||||
{"learn":[0.3397309627],"iteration":258,"passed_time":0.2893273515,"remaining_time":0.157510257},
|
||||
{"learn":[0.339253501],"iteration":259,"passed_time":0.2904178244,"remaining_time":0.1563788285},
|
||||
{"learn":[0.3388066139],"iteration":260,"passed_time":0.2915355476,"remaining_time":0.1552622265},
|
||||
{"learn":[0.3384464664],"iteration":261,"passed_time":0.292620937,"remaining_time":0.1541285852},
|
||||
{"learn":[0.3379404375],"iteration":262,"passed_time":0.2936824928,"remaining_time":0.1529828955},
|
||||
{"learn":[0.3375414354],"iteration":263,"passed_time":0.2948104245,"remaining_time":0.1518720369},
|
||||
{"learn":[0.3370821259],"iteration":264,"passed_time":0.295924856,"remaining_time":0.1507541719},
|
||||
{"learn":[0.336602236],"iteration":265,"passed_time":0.2970121205,"remaining_time":0.1496226472},
|
||||
{"learn":[0.3362749],"iteration":266,"passed_time":0.2981132185,"remaining_time":0.1484983448},
|
||||
{"learn":[0.3356858224],"iteration":267,"passed_time":0.2991777743,"remaining_time":0.1473562172},
|
||||
{"learn":[0.3352310019],"iteration":268,"passed_time":0.3003209145,"remaining_time":0.1462529361},
|
||||
{"learn":[0.3348569493],"iteration":269,"passed_time":0.3014208042,"remaining_time":0.1451285354},
|
||||
{"learn":[0.3343571837],"iteration":270,"passed_time":0.3025719445,"remaining_time":0.1440287116},
|
||||
{"learn":[0.333972653],"iteration":271,"passed_time":0.3036274169,"remaining_time":0.1428834903},
|
||||
{"learn":[0.3334731775],"iteration":272,"passed_time":0.3047476818,"remaining_time":0.1417690681},
|
||||
{"learn":[0.3330291212],"iteration":273,"passed_time":0.3058505715,"remaining_time":0.1406466132},
|
||||
{"learn":[0.3326605023],"iteration":274,"passed_time":0.3069655863,"remaining_time":0.139529812},
|
||||
{"learn":[0.3321437127],"iteration":275,"passed_time":0.3080452674,"remaining_time":0.1383971491},
|
||||
{"learn":[0.3315365701],"iteration":276,"passed_time":0.3091012398,"remaining_time":0.1372543411},
|
||||
{"learn":[0.3310604688],"iteration":277,"passed_time":0.3101988377,"remaining_time":0.1361304252},
|
||||
{"learn":[0.3306178809],"iteration":278,"passed_time":0.3113700616,"remaining_time":0.1350386289},
|
||||
{"learn":[0.3302189522],"iteration":279,"passed_time":0.3124655346,"remaining_time":0.1339138005},
|
||||
{"learn":[0.3298908388],"iteration":280,"passed_time":0.3135639658,"remaining_time":0.1327904339},
|
||||
{"learn":[0.3296290713],"iteration":281,"passed_time":0.3147306064,"remaining_time":0.1316957856},
|
||||
{"learn":[0.3292322275],"iteration":282,"passed_time":0.3159200389,"remaining_time":0.1306100514},
|
||||
{"learn":[0.3289530144],"iteration":283,"passed_time":0.3171967225,"remaining_time":0.1295592247},
|
||||
{"learn":[0.3283868788],"iteration":284,"passed_time":0.3182564866,"remaining_time":0.1284192841},
|
||||
{"learn":[0.3279859547],"iteration":285,"passed_time":0.3193458345,"remaining_time":0.1272916963},
|
||||
{"learn":[0.3276029024],"iteration":286,"passed_time":0.3205133917,"remaining_time":0.1261951682},
|
||||
{"learn":[0.3269980903],"iteration":287,"passed_time":0.3216701571,"remaining_time":0.12509395},
|
||||
{"learn":[0.3265024345],"iteration":288,"passed_time":0.3228997151,"remaining_time":0.1240203058},
|
||||
{"learn":[0.3260926102],"iteration":289,"passed_time":0.3239976464,"remaining_time":0.122895659},
|
||||
{"learn":[0.3255902536],"iteration":290,"passed_time":0.3250561605,"remaining_time":0.1217564312},
|
||||
{"learn":[0.3253374601],"iteration":291,"passed_time":0.3262455513,"remaining_time":0.1206661628},
|
||||
{"learn":[0.3249964957],"iteration":292,"passed_time":0.3274385255,"remaining_time":0.1195765264},
|
||||
{"learn":[0.3247110169],"iteration":293,"passed_time":0.3286553334,"remaining_time":0.1184947801},
|
||||
{"learn":[0.3244365598],"iteration":294,"passed_time":0.3297882652,"remaining_time":0.1173822639},
|
||||
{"learn":[0.3236145686],"iteration":295,"passed_time":0.3309152385,"remaining_time":0.1162675162},
|
||||
{"learn":[0.3232270981],"iteration":296,"passed_time":0.332130463,"remaining_time":0.1151832919},
|
||||
{"learn":[0.3228851393],"iteration":297,"passed_time":0.3332317693,"remaining_time":0.1140591962},
|
||||
{"learn":[0.3225358685],"iteration":298,"passed_time":0.3343837013,"remaining_time":0.112952354},
|
||||
{"learn":[0.3221528653],"iteration":299,"passed_time":0.3356189678,"remaining_time":0.1118729893},
|
||||
{"learn":[0.3214501982],"iteration":300,"passed_time":0.3367013988,"remaining_time":0.1107423206},
|
||||
{"learn":[0.320997221],"iteration":301,"passed_time":0.3378206637,"remaining_time":0.109623924},
|
||||
{"learn":[0.3206101631],"iteration":302,"passed_time":0.3389297202,"remaining_time":0.1085022537},
|
||||
{"learn":[0.3201732621],"iteration":303,"passed_time":0.3399921927,"remaining_time":0.1073659556},
|
||||
{"learn":[0.3199084998],"iteration":304,"passed_time":0.3411286661,"remaining_time":0.1062531911},
|
||||
{"learn":[0.3195992788],"iteration":305,"passed_time":0.3422892649,"remaining_time":0.1051476827},
|
||||
{"learn":[0.3191488459],"iteration":306,"passed_time":0.3433914879,"remaining_time":0.1040241315},
|
||||
{"learn":[0.3187874781],"iteration":307,"passed_time":0.3444620855,"remaining_time":0.1028912723},
|
||||
{"learn":[0.3185523705],"iteration":308,"passed_time":0.3456197676,"remaining_time":0.1017844623},
|
||||
{"learn":[0.3183052639],"iteration":309,"passed_time":0.3467240323,"remaining_time":0.1006618158},
|
||||
{"learn":[0.3179523493],"iteration":310,"passed_time":0.3479116314,"remaining_time":0.09956313568},
|
||||
{"learn":[0.3173939542],"iteration":311,"passed_time":0.3490191878,"remaining_time":0.09844130939},
|
||||
{"learn":[0.3170235217],"iteration":312,"passed_time":0.3500825353,"remaining_time":0.09730728617},
|
||||
{"learn":[0.3167426475],"iteration":313,"passed_time":0.3512368007,"remaining_time":0.0961986142},
|
||||
{"learn":[0.3163718121],"iteration":314,"passed_time":0.3523208568,"remaining_time":0.09507070738},
|
||||
{"learn":[0.3158370493],"iteration":315,"passed_time":0.3534916224,"remaining_time":0.09396612746},
|
||||
{"learn":[0.3155503527],"iteration":316,"passed_time":0.3545707201,"remaining_time":0.0928371286},
|
||||
{"learn":[0.3151236337],"iteration":317,"passed_time":0.3557036935,"remaining_time":0.09172233605},
|
||||
{"learn":[0.3148689295],"iteration":318,"passed_time":0.3567603742,"remaining_time":0.0905880574},
|
||||
{"learn":[0.3146299768],"iteration":319,"passed_time":0.3578028881,"remaining_time":0.08945072202},
|
||||
{"learn":[0.3142772407],"iteration":320,"passed_time":0.3588606938,"remaining_time":0.08831774085},
|
||||
{"learn":[0.3138530784],"iteration":321,"passed_time":0.360001834,"remaining_time":0.08720541321},
|
||||
{"learn":[0.3135854205],"iteration":322,"passed_time":0.3611158489,"remaining_time":0.08608644075},
|
||||
{"learn":[0.3131214904],"iteration":323,"passed_time":0.3621631545,"remaining_time":0.08495185105},
|
||||
{"learn":[0.3127659838],"iteration":324,"passed_time":0.3632967112,"remaining_time":0.08383770259},
|
||||
{"learn":[0.3122350721],"iteration":325,"passed_time":0.3643763506,"remaining_time":0.08271119615},
|
||||
{"learn":[0.3118475636],"iteration":326,"passed_time":0.3655228659,"remaining_time":0.08159990583},
|
||||
{"learn":[0.3115344437],"iteration":327,"passed_time":0.3666650894,"remaining_time":0.08048745865},
|
||||
{"learn":[0.311237246],"iteration":328,"passed_time":0.3677735625,"remaining_time":0.07936754692},
|
||||
{"learn":[0.3109110889],"iteration":329,"passed_time":0.3688446184,"remaining_time":0.07823976754},
|
||||
{"learn":[0.310639938],"iteration":330,"passed_time":0.37009251,"remaining_time":0.07714919393},
|
||||
{"learn":[0.3103155862],"iteration":331,"passed_time":0.3711809828,"remaining_time":0.07602502058},
|
||||
{"learn":[0.3098221248],"iteration":332,"passed_time":0.3723168313,"remaining_time":0.07491059368},
|
||||
{"learn":[0.309423914],"iteration":333,"passed_time":0.3734389712,"remaining_time":0.07379332964},
|
||||
{"learn":[0.3091671621],"iteration":334,"passed_time":0.3746966546,"remaining_time":0.07270233598},
|
||||
{"learn":[0.308852111],"iteration":335,"passed_time":0.3758094611,"remaining_time":0.0715827545},
|
||||
{"learn":[0.3084452031],"iteration":336,"passed_time":0.3769338511,"remaining_time":0.07046537869},
|
||||
{"learn":[0.30805284],"iteration":337,"passed_time":0.3780220739,"remaining_time":0.06934132717},
|
||||
{"learn":[0.307790852],"iteration":338,"passed_time":0.3791067133,"remaining_time":0.06821684222},
|
||||
{"learn":[0.3075070726],"iteration":339,"passed_time":0.3801461439,"remaining_time":0.06708461362},
|
||||
{"learn":[0.3070106772],"iteration":340,"passed_time":0.3812151164,"remaining_time":0.06595804067},
|
||||
{"learn":[0.3063522606],"iteration":341,"passed_time":0.3823247145,"remaining_time":0.06483869428},
|
||||
{"learn":[0.306023137],"iteration":342,"passed_time":0.3834944384,"remaining_time":0.06372939647},
|
||||
{"learn":[0.3056081686],"iteration":343,"passed_time":0.3845728694,"remaining_time":0.06260488572},
|
||||
{"learn":[0.3052908972],"iteration":344,"passed_time":0.3857046345,"remaining_time":0.06148914463},
|
||||
{"learn":[0.3050698337],"iteration":345,"passed_time":0.3867824405,"remaining_time":0.06036488956},
|
||||
{"learn":[0.304718801],"iteration":346,"passed_time":0.3878819552,"remaining_time":0.05924421794},
|
||||
{"learn":[0.3043544625],"iteration":347,"passed_time":0.3890576375,"remaining_time":0.05813504928},
|
||||
{"learn":[0.3041033502],"iteration":348,"passed_time":0.3902497784,"remaining_time":0.05702790457},
|
||||
{"learn":[0.3037743316],"iteration":349,"passed_time":0.3913301677,"remaining_time":0.05590430968},
|
||||
{"learn":[0.3034668293],"iteration":350,"passed_time":0.392504225,"remaining_time":0.05479403711},
|
||||
{"learn":[0.3030885587],"iteration":351,"passed_time":0.3938031173,"remaining_time":0.05370042509},
|
||||
{"learn":[0.3026812327],"iteration":352,"passed_time":0.3948736316,"remaining_time":0.05257524273},
|
||||
{"learn":[0.3021014274],"iteration":353,"passed_time":0.3959924381,"remaining_time":0.0514566445},
|
||||
{"learn":[0.3018628727],"iteration":354,"passed_time":0.3971618287,"remaining_time":0.05034445716},
|
||||
{"learn":[0.3015681515],"iteration":355,"passed_time":0.398210676,"remaining_time":0.04921704984},
|
||||
{"learn":[0.3012563129],"iteration":356,"passed_time":0.3994373173,"remaining_time":0.0481114976},
|
||||
{"learn":[0.3008425713],"iteration":357,"passed_time":0.4005401653,"remaining_time":0.04699074565},
|
||||
{"learn":[0.3006504824],"iteration":358,"passed_time":0.4017283478,"remaining_time":0.04587983917},
|
||||
{"learn":[0.3002997122],"iteration":359,"passed_time":0.4028637796,"remaining_time":0.04476264218},
|
||||
{"learn":[0.29986022],"iteration":360,"passed_time":0.4039345855,"remaining_time":0.04363836243},
|
||||
{"learn":[0.2994157375],"iteration":361,"passed_time":0.4049831411,"remaining_time":0.04251204244},
|
||||
{"learn":[0.2991488897],"iteration":362,"passed_time":0.4060736973,"remaining_time":0.04139043196},
|
||||
{"learn":[0.2987604674],"iteration":363,"passed_time":0.4071648369,"remaining_time":0.0402690498},
|
||||
{"learn":[0.2984520322],"iteration":364,"passed_time":0.4083211439,"remaining_time":0.03915408229},
|
||||
{"learn":[0.2980086594],"iteration":365,"passed_time":0.4094280337,"remaining_time":0.03803429821},
|
||||
{"learn":[0.2976722806],"iteration":366,"passed_time":0.4105029646,"remaining_time":0.03691171072},
|
||||
{"learn":[0.297418779],"iteration":367,"passed_time":0.4116947305,"remaining_time":0.03579954178},
|
||||
{"learn":[0.2970540834],"iteration":368,"passed_time":0.4128054119,"remaining_time":0.03468012946},
|
||||
{"learn":[0.2968505628],"iteration":369,"passed_time":0.4138733428,"remaining_time":0.03355729807},
|
||||
{"learn":[0.2966096352],"iteration":370,"passed_time":0.4149656907,"remaining_time":0.03243667124},
|
||||
{"learn":[0.2962534879],"iteration":371,"passed_time":0.4159768292,"remaining_time":0.03131008392},
|
||||
{"learn":[0.2956966575],"iteration":372,"passed_time":0.4170019261,"remaining_time":0.03018512602},
|
||||
{"learn":[0.295467724],"iteration":373,"passed_time":0.4181140243,"remaining_time":0.02906675035},
|
||||
{"learn":[0.295198672],"iteration":374,"passed_time":0.4192409559,"remaining_time":0.02794939706},
|
||||
{"learn":[0.2948654216],"iteration":375,"passed_time":0.4202776364,"remaining_time":0.02682623211},
|
||||
{"learn":[0.2944509322],"iteration":376,"passed_time":0.4213771094,"remaining_time":0.02570735681},
|
||||
{"learn":[0.294163659],"iteration":377,"passed_time":0.4226436679,"remaining_time":0.02459830871},
|
||||
{"learn":[0.2938644764],"iteration":378,"passed_time":0.4237322241,"remaining_time":0.02347856651},
|
||||
{"learn":[0.293532816],"iteration":379,"passed_time":0.4248420722,"remaining_time":0.02236010906},
|
||||
{"learn":[0.2932769543],"iteration":380,"passed_time":0.4259474202,"remaining_time":0.0212414724},
|
||||
{"learn":[0.2930012713],"iteration":381,"passed_time":0.4270412265,"remaining_time":0.02012236146},
|
||||
{"learn":[0.2927528101],"iteration":382,"passed_time":0.4281576163,"remaining_time":0.01900438506},
|
||||
{"learn":[0.2924546703],"iteration":383,"passed_time":0.4292129637,"remaining_time":0.01788387349},
|
||||
{"learn":[0.2921348133],"iteration":384,"passed_time":0.4303516039,"remaining_time":0.0167669456},
|
||||
{"learn":[0.2918413938],"iteration":385,"passed_time":0.4314503685,"remaining_time":0.01564845896},
|
||||
{"learn":[0.2914998283],"iteration":386,"passed_time":0.4325481331,"remaining_time":0.01453004065},
|
||||
{"learn":[0.2912741093],"iteration":387,"passed_time":0.4336954817,"remaining_time":0.01341326232},
|
||||
{"learn":[0.2910467504],"iteration":388,"passed_time":0.4347749961,"remaining_time":0.01229440863},
|
||||
{"learn":[0.2908811787],"iteration":389,"passed_time":0.4359572618,"remaining_time":0.01117839133},
|
||||
{"learn":[0.29031764],"iteration":390,"passed_time":0.4370190259,"remaining_time":0.01005926147},
|
||||
{"learn":[0.2900000009],"iteration":391,"passed_time":0.4381199989,"remaining_time":0.008941224468},
|
||||
{"learn":[0.2897507124],"iteration":392,"passed_time":0.4392080968,"remaining_time":0.00782304498},
|
||||
{"learn":[0.2895248451],"iteration":393,"passed_time":0.4403091947,"remaining_time":0.006705216164},
|
||||
{"learn":[0.2892178364],"iteration":394,"passed_time":0.4414087927,"remaining_time":0.005587453072},
|
||||
{"learn":[0.2888956874],"iteration":395,"passed_time":0.442581475,"remaining_time":0.004470519949},
|
||||
{"learn":[0.2885872177],"iteration":396,"passed_time":0.443805658,"remaining_time":0.003353695148},
|
||||
{"learn":[0.2883226548],"iteration":397,"passed_time":0.4449120477,"remaining_time":0.002235738933},
|
||||
{"learn":[0.2880616544],"iteration":398,"passed_time":0.4460379793,"remaining_time":0.001117889673},
|
||||
{"learn":[0.2877225749],"iteration":399,"passed_time":0.4471239521,"remaining_time":0}
|
||||
]}
|
||||
@@ -1,401 +0,0 @@
|
||||
iter Logloss
|
||||
0 0.6752574527
|
||||
1 0.6590158329
|
||||
2 0.6439053461
|
||||
3 0.6300318652
|
||||
4 0.6176080869
|
||||
5 0.6072057723
|
||||
6 0.5978862443
|
||||
7 0.5892253742
|
||||
8 0.5808671388
|
||||
9 0.5732077946
|
||||
10 0.5661847426
|
||||
11 0.5600289293
|
||||
12 0.5530962469
|
||||
13 0.5481010119
|
||||
14 0.5434953481
|
||||
15 0.5404101637
|
||||
16 0.5361341938
|
||||
17 0.5317763411
|
||||
18 0.5268163473
|
||||
19 0.5245315654
|
||||
20 0.5205327316
|
||||
21 0.5177701576
|
||||
22 0.5137445796
|
||||
23 0.5105456834
|
||||
24 0.5080257838
|
||||
25 0.5054934276
|
||||
26 0.503296382
|
||||
27 0.5006211207
|
||||
28 0.4985921934
|
||||
29 0.4961473489
|
||||
30 0.4946219665
|
||||
31 0.4925272328
|
||||
32 0.4898936852
|
||||
33 0.4884288887
|
||||
34 0.4863838977
|
||||
35 0.4845515615
|
||||
36 0.4824883347
|
||||
37 0.4804030524
|
||||
38 0.4785388461
|
||||
39 0.4770942099
|
||||
40 0.4756384413
|
||||
41 0.4747696424
|
||||
42 0.4736129814
|
||||
43 0.4725400991
|
||||
44 0.4712424271
|
||||
45 0.4701835699
|
||||
46 0.4690223311
|
||||
47 0.4682401998
|
||||
48 0.4663252757
|
||||
49 0.4651951732
|
||||
50 0.4643129126
|
||||
51 0.4634919617
|
||||
52 0.4627711631
|
||||
53 0.4618109601
|
||||
54 0.460959898
|
||||
55 0.4594625002
|
||||
56 0.4584854101
|
||||
57 0.4570498581
|
||||
58 0.455880592
|
||||
59 0.4550663099
|
||||
60 0.4542687957
|
||||
61 0.4535032807
|
||||
62 0.4526542794
|
||||
63 0.4514785115
|
||||
64 0.4507802979
|
||||
65 0.4491962574
|
||||
66 0.4485895185
|
||||
67 0.4478692379
|
||||
68 0.4463417221
|
||||
69 0.4452451739
|
||||
70 0.4444830618
|
||||
71 0.4435724065
|
||||
72 0.4420487712
|
||||
73 0.441478802
|
||||
74 0.4410124289
|
||||
75 0.4401138277
|
||||
76 0.4394535191
|
||||
77 0.4388369011
|
||||
78 0.4379911776
|
||||
79 0.4374327656
|
||||
80 0.4364149666
|
||||
81 0.4358972456
|
||||
82 0.4352582245
|
||||
83 0.4345396736
|
||||
84 0.4341003864
|
||||
85 0.4332298157
|
||||
86 0.43230384
|
||||
87 0.4316562364
|
||||
88 0.4309618622
|
||||
89 0.4298558624
|
||||
90 0.4291876524
|
||||
91 0.4282528408
|
||||
92 0.4277131957
|
||||
93 0.4271829294
|
||||
94 0.4264580876
|
||||
95 0.4253379692
|
||||
96 0.424511763
|
||||
97 0.4239388347
|
||||
98 0.4232630534
|
||||
99 0.4226485557
|
||||
100 0.4222437514
|
||||
101 0.4213299083
|
||||
102 0.4208753627
|
||||
103 0.420347864
|
||||
104 0.4191908122
|
||||
105 0.4183297442
|
||||
106 0.417987752
|
||||
107 0.4174588649
|
||||
108 0.4169787866
|
||||
109 0.4159189441
|
||||
110 0.4153188878
|
||||
111 0.4148918317
|
||||
112 0.4144564688
|
||||
113 0.4138592532
|
||||
114 0.4133895004
|
||||
115 0.4127703464
|
||||
116 0.4124298162
|
||||
117 0.4120395574
|
||||
118 0.4107360285
|
||||
119 0.4101591941
|
||||
120 0.4092665733
|
||||
121 0.4088576793
|
||||
122 0.408361342
|
||||
123 0.4078673303
|
||||
124 0.4073910152
|
||||
125 0.4066843028
|
||||
126 0.4062068195
|
||||
127 0.4054839673
|
||||
128 0.4049627816
|
||||
129 0.4042386686
|
||||
130 0.4036896032
|
||||
131 0.4030055463
|
||||
132 0.4025982201
|
||||
133 0.4021507256
|
||||
134 0.4017130107
|
||||
135 0.4010693391
|
||||
136 0.400549588
|
||||
137 0.3999916469
|
||||
138 0.3996655064
|
||||
139 0.3993175997
|
||||
140 0.3989923873
|
||||
141 0.3985453884
|
||||
142 0.3980582085
|
||||
143 0.3978472172
|
||||
144 0.3973697391
|
||||
145 0.3970929708
|
||||
146 0.3966356443
|
||||
147 0.3962418114
|
||||
148 0.3958183212
|
||||
149 0.3952962072
|
||||
150 0.3947786724
|
||||
151 0.3942251128
|
||||
152 0.393510771
|
||||
153 0.3931935538
|
||||
154 0.3929263145
|
||||
155 0.3921994504
|
||||
156 0.3918641893
|
||||
157 0.391568347
|
||||
158 0.3907576665
|
||||
159 0.3900011029
|
||||
160 0.3896939448
|
||||
161 0.3892669751
|
||||
162 0.3887156987
|
||||
163 0.3882799657
|
||||
164 0.3878736136
|
||||
165 0.3873377012
|
||||
166 0.3868683205
|
||||
167 0.3863639324
|
||||
168 0.3856756608
|
||||
169 0.3851101196
|
||||
170 0.3845899076
|
||||
171 0.3842809463
|
||||
172 0.3838979772
|
||||
173 0.3835421864
|
||||
174 0.3831593151
|
||||
175 0.3824219971
|
||||
176 0.3818750513
|
||||
177 0.3814587697
|
||||
178 0.3811315933
|
||||
179 0.3806289168
|
||||
180 0.3801948808
|
||||
181 0.3793927537
|
||||
182 0.379061847
|
||||
183 0.3786859738
|
||||
184 0.3783497847
|
||||
185 0.3780392163
|
||||
186 0.3773187067
|
||||
187 0.3768762307
|
||||
188 0.3763556852
|
||||
189 0.3756938863
|
||||
190 0.3752401881
|
||||
191 0.3747042165
|
||||
192 0.3741421572
|
||||
193 0.3737531083
|
||||
194 0.3729714636
|
||||
195 0.3723401504
|
||||
196 0.3717195748
|
||||
197 0.3713120882
|
||||
198 0.3706316865
|
||||
199 0.3702966116
|
||||
200 0.3697721904
|
||||
201 0.3690342594
|
||||
202 0.3685483475
|
||||
203 0.3679488892
|
||||
204 0.3674652876
|
||||
205 0.3661867815
|
||||
206 0.3655245649
|
||||
207 0.3651419912
|
||||
208 0.3648638467
|
||||
209 0.3645890135
|
||||
210 0.3641188983
|
||||
211 0.3636023273
|
||||
212 0.3625971287
|
||||
213 0.3620963436
|
||||
214 0.3613752339
|
||||
215 0.3609288026
|
||||
216 0.3602546044
|
||||
217 0.3596176626
|
||||
218 0.3591174894
|
||||
219 0.3584672055
|
||||
220 0.3579661615
|
||||
221 0.3575125863
|
||||
222 0.3570908255
|
||||
223 0.3565320443
|
||||
224 0.3557740348
|
||||
225 0.3552039883
|
||||
226 0.3546823154
|
||||
227 0.3542588096
|
||||
228 0.3539054745
|
||||
229 0.3532278683
|
||||
230 0.3529230362
|
||||
231 0.352381597
|
||||
232 0.3518928383
|
||||
233 0.3513050813
|
||||
234 0.3508996451
|
||||
235 0.3504190546
|
||||
236 0.350020568
|
||||
237 0.3495522954
|
||||
238 0.349180171
|
||||
239 0.3488403456
|
||||
240 0.348326175
|
||||
241 0.3480609146
|
||||
242 0.3474846933
|
||||
243 0.3470838691
|
||||
244 0.3464878166
|
||||
245 0.3461395179
|
||||
246 0.3452807894
|
||||
247 0.3449142029
|
||||
248 0.3443799395
|
||||
249 0.3438780899
|
||||
250 0.343511803
|
||||
251 0.3430115446
|
||||
252 0.3424726164
|
||||
253 0.3420562225
|
||||
254 0.34149691
|
||||
255 0.3409610654
|
||||
256 0.3405231536
|
||||
257 0.340034093
|
||||
258 0.3397309627
|
||||
259 0.339253501
|
||||
260 0.3388066139
|
||||
261 0.3384464664
|
||||
262 0.3379404375
|
||||
263 0.3375414354
|
||||
264 0.3370821259
|
||||
265 0.336602236
|
||||
266 0.3362749
|
||||
267 0.3356858224
|
||||
268 0.3352310019
|
||||
269 0.3348569493
|
||||
270 0.3343571837
|
||||
271 0.333972653
|
||||
272 0.3334731775
|
||||
273 0.3330291212
|
||||
274 0.3326605023
|
||||
275 0.3321437127
|
||||
276 0.3315365701
|
||||
277 0.3310604688
|
||||
278 0.3306178809
|
||||
279 0.3302189522
|
||||
280 0.3298908388
|
||||
281 0.3296290713
|
||||
282 0.3292322275
|
||||
283 0.3289530144
|
||||
284 0.3283868788
|
||||
285 0.3279859547
|
||||
286 0.3276029024
|
||||
287 0.3269980903
|
||||
288 0.3265024345
|
||||
289 0.3260926102
|
||||
290 0.3255902536
|
||||
291 0.3253374601
|
||||
292 0.3249964957
|
||||
293 0.3247110169
|
||||
294 0.3244365598
|
||||
295 0.3236145686
|
||||
296 0.3232270981
|
||||
297 0.3228851393
|
||||
298 0.3225358685
|
||||
299 0.3221528653
|
||||
300 0.3214501982
|
||||
301 0.320997221
|
||||
302 0.3206101631
|
||||
303 0.3201732621
|
||||
304 0.3199084998
|
||||
305 0.3195992788
|
||||
306 0.3191488459
|
||||
307 0.3187874781
|
||||
308 0.3185523705
|
||||
309 0.3183052639
|
||||
310 0.3179523493
|
||||
311 0.3173939542
|
||||
312 0.3170235217
|
||||
313 0.3167426475
|
||||
314 0.3163718121
|
||||
315 0.3158370493
|
||||
316 0.3155503527
|
||||
317 0.3151236337
|
||||
318 0.3148689295
|
||||
319 0.3146299768
|
||||
320 0.3142772407
|
||||
321 0.3138530784
|
||||
322 0.3135854205
|
||||
323 0.3131214904
|
||||
324 0.3127659838
|
||||
325 0.3122350721
|
||||
326 0.3118475636
|
||||
327 0.3115344437
|
||||
328 0.311237246
|
||||
329 0.3109110889
|
||||
330 0.310639938
|
||||
331 0.3103155862
|
||||
332 0.3098221248
|
||||
333 0.309423914
|
||||
334 0.3091671621
|
||||
335 0.308852111
|
||||
336 0.3084452031
|
||||
337 0.30805284
|
||||
338 0.307790852
|
||||
339 0.3075070726
|
||||
340 0.3070106772
|
||||
341 0.3063522606
|
||||
342 0.306023137
|
||||
343 0.3056081686
|
||||
344 0.3052908972
|
||||
345 0.3050698337
|
||||
346 0.304718801
|
||||
347 0.3043544625
|
||||
348 0.3041033502
|
||||
349 0.3037743316
|
||||
350 0.3034668293
|
||||
351 0.3030885587
|
||||
352 0.3026812327
|
||||
353 0.3021014274
|
||||
354 0.3018628727
|
||||
355 0.3015681515
|
||||
356 0.3012563129
|
||||
357 0.3008425713
|
||||
358 0.3006504824
|
||||
359 0.3002997122
|
||||
360 0.29986022
|
||||
361 0.2994157375
|
||||
362 0.2991488897
|
||||
363 0.2987604674
|
||||
364 0.2984520322
|
||||
365 0.2980086594
|
||||
366 0.2976722806
|
||||
367 0.297418779
|
||||
368 0.2970540834
|
||||
369 0.2968505628
|
||||
370 0.2966096352
|
||||
371 0.2962534879
|
||||
372 0.2956966575
|
||||
373 0.295467724
|
||||
374 0.295198672
|
||||
375 0.2948654216
|
||||
376 0.2944509322
|
||||
377 0.294163659
|
||||
378 0.2938644764
|
||||
379 0.293532816
|
||||
380 0.2932769543
|
||||
381 0.2930012713
|
||||
382 0.2927528101
|
||||
383 0.2924546703
|
||||
384 0.2921348133
|
||||
385 0.2918413938
|
||||
386 0.2914998283
|
||||
387 0.2912741093
|
||||
388 0.2910467504
|
||||
389 0.2908811787
|
||||
390 0.29031764
|
||||
391 0.2900000009
|
||||
392 0.2897507124
|
||||
393 0.2895248451
|
||||
394 0.2892178364
|
||||
395 0.2888956874
|
||||
396 0.2885872177
|
||||
397 0.2883226548
|
||||
398 0.2880616544
|
||||
399 0.2877225749
|
||||
|
@@ -1,401 +0,0 @@
|
||||
iter Passed Remaining
|
||||
0 1 459
|
||||
1 2 459
|
||||
2 3 445
|
||||
3 4 443
|
||||
4 5 441
|
||||
5 6 437
|
||||
6 7 434
|
||||
7 8 435
|
||||
8 9 433
|
||||
9 11 429
|
||||
10 12 429
|
||||
11 13 427
|
||||
12 14 424
|
||||
13 15 421
|
||||
14 16 421
|
||||
15 17 421
|
||||
16 18 419
|
||||
17 19 418
|
||||
18 20 417
|
||||
19 21 414
|
||||
20 22 413
|
||||
21 24 412
|
||||
22 25 410
|
||||
23 26 409
|
||||
24 27 409
|
||||
25 28 409
|
||||
26 29 408
|
||||
27 30 407
|
||||
28 31 407
|
||||
29 33 407
|
||||
30 34 406
|
||||
31 35 406
|
||||
32 36 405
|
||||
33 37 405
|
||||
34 38 404
|
||||
35 39 403
|
||||
36 41 403
|
||||
37 42 402
|
||||
38 43 401
|
||||
39 44 401
|
||||
40 45 399
|
||||
41 46 398
|
||||
42 48 398
|
||||
43 49 397
|
||||
44 50 395
|
||||
45 51 395
|
||||
46 52 394
|
||||
47 53 393
|
||||
48 54 391
|
||||
49 55 390
|
||||
50 56 389
|
||||
51 57 387
|
||||
52 59 387
|
||||
53 60 385
|
||||
54 61 384
|
||||
55 62 382
|
||||
56 63 381
|
||||
57 64 380
|
||||
58 65 378
|
||||
59 66 377
|
||||
60 67 376
|
||||
61 68 374
|
||||
62 69 373
|
||||
63 71 372
|
||||
64 72 371
|
||||
65 73 370
|
||||
66 74 369
|
||||
67 75 368
|
||||
68 76 367
|
||||
69 77 366
|
||||
70 78 364
|
||||
71 79 363
|
||||
72 80 362
|
||||
73 81 361
|
||||
74 83 360
|
||||
75 84 358
|
||||
76 85 357
|
||||
77 86 356
|
||||
78 87 355
|
||||
79 88 354
|
||||
80 89 353
|
||||
81 90 352
|
||||
82 91 351
|
||||
83 93 349
|
||||
84 94 348
|
||||
85 95 347
|
||||
86 96 346
|
||||
87 97 345
|
||||
88 98 344
|
||||
89 99 342
|
||||
90 100 341
|
||||
91 101 340
|
||||
92 102 339
|
||||
93 103 338
|
||||
94 104 336
|
||||
95 105 335
|
||||
96 107 334
|
||||
97 108 333
|
||||
98 109 332
|
||||
99 110 331
|
||||
100 111 330
|
||||
101 112 329
|
||||
102 113 328
|
||||
103 115 327
|
||||
104 116 326
|
||||
105 117 325
|
||||
106 118 324
|
||||
107 119 323
|
||||
108 120 322
|
||||
109 121 321
|
||||
110 122 320
|
||||
111 124 318
|
||||
112 125 317
|
||||
113 126 316
|
||||
114 127 315
|
||||
115 128 314
|
||||
116 129 313
|
||||
117 130 312
|
||||
118 131 311
|
||||
119 132 310
|
||||
120 134 309
|
||||
121 135 307
|
||||
122 136 306
|
||||
123 137 305
|
||||
124 138 304
|
||||
125 139 303
|
||||
126 140 302
|
||||
127 142 301
|
||||
128 143 300
|
||||
129 144 299
|
||||
130 145 298
|
||||
131 146 297
|
||||
132 147 296
|
||||
133 148 295
|
||||
134 149 293
|
||||
135 150 292
|
||||
136 152 291
|
||||
137 153 290
|
||||
138 154 289
|
||||
139 155 288
|
||||
140 156 287
|
||||
141 157 286
|
||||
142 158 285
|
||||
143 159 284
|
||||
144 161 283
|
||||
145 162 282
|
||||
146 163 281
|
||||
147 164 280
|
||||
148 165 279
|
||||
149 166 277
|
||||
150 167 276
|
||||
151 168 275
|
||||
152 170 275
|
||||
153 171 274
|
||||
154 172 273
|
||||
155 173 272
|
||||
156 175 270
|
||||
157 176 269
|
||||
158 177 268
|
||||
159 178 267
|
||||
160 179 266
|
||||
161 180 265
|
||||
162 181 264
|
||||
163 182 263
|
||||
164 183 261
|
||||
165 185 260
|
||||
166 186 259
|
||||
167 187 258
|
||||
168 188 257
|
||||
169 189 256
|
||||
170 190 255
|
||||
171 191 254
|
||||
172 192 253
|
||||
173 193 251
|
||||
174 195 250
|
||||
175 196 249
|
||||
176 197 248
|
||||
177 198 247
|
||||
178 199 246
|
||||
179 200 245
|
||||
180 201 243
|
||||
181 202 242
|
||||
182 203 241
|
||||
183 205 240
|
||||
184 206 239
|
||||
185 207 238
|
||||
186 208 237
|
||||
187 209 236
|
||||
188 210 235
|
||||
189 211 234
|
||||
190 213 233
|
||||
191 214 231
|
||||
192 215 230
|
||||
193 216 229
|
||||
194 217 228
|
||||
195 218 227
|
||||
196 219 226
|
||||
197 220 225
|
||||
198 221 223
|
||||
199 222 222
|
||||
200 224 221
|
||||
201 225 220
|
||||
202 226 219
|
||||
203 227 218
|
||||
204 228 217
|
||||
205 229 216
|
||||
206 230 215
|
||||
207 231 214
|
||||
208 233 213
|
||||
209 234 211
|
||||
210 235 210
|
||||
211 236 209
|
||||
212 237 208
|
||||
213 238 207
|
||||
214 239 206
|
||||
215 240 205
|
||||
216 242 204
|
||||
217 243 202
|
||||
218 244 201
|
||||
219 245 200
|
||||
220 246 199
|
||||
221 247 198
|
||||
222 248 197
|
||||
223 249 196
|
||||
224 251 195
|
||||
225 252 194
|
||||
226 253 193
|
||||
227 254 191
|
||||
228 255 190
|
||||
229 256 189
|
||||
230 257 188
|
||||
231 258 187
|
||||
232 260 186
|
||||
233 261 185
|
||||
234 262 184
|
||||
235 263 183
|
||||
236 264 181
|
||||
237 265 180
|
||||
238 266 179
|
||||
239 267 178
|
||||
240 269 177
|
||||
241 270 176
|
||||
242 271 175
|
||||
243 272 174
|
||||
244 273 173
|
||||
245 274 172
|
||||
246 275 170
|
||||
247 277 169
|
||||
248 278 168
|
||||
249 279 167
|
||||
250 280 166
|
||||
251 281 165
|
||||
252 282 164
|
||||
253 283 163
|
||||
254 285 162
|
||||
255 286 160
|
||||
256 287 159
|
||||
257 288 158
|
||||
258 289 157
|
||||
259 290 156
|
||||
260 291 155
|
||||
261 292 154
|
||||
262 293 152
|
||||
263 294 151
|
||||
264 295 150
|
||||
265 297 149
|
||||
266 298 148
|
||||
267 299 147
|
||||
268 300 146
|
||||
269 301 145
|
||||
270 302 144
|
||||
271 303 142
|
||||
272 304 141
|
||||
273 305 140
|
||||
274 306 139
|
||||
275 308 138
|
||||
276 309 137
|
||||
277 310 136
|
||||
278 311 135
|
||||
279 312 133
|
||||
280 313 132
|
||||
281 314 131
|
||||
282 315 130
|
||||
283 317 129
|
||||
284 318 128
|
||||
285 319 127
|
||||
286 320 126
|
||||
287 321 125
|
||||
288 322 124
|
||||
289 323 122
|
||||
290 325 121
|
||||
291 326 120
|
||||
292 327 119
|
||||
293 328 118
|
||||
294 329 117
|
||||
295 330 116
|
||||
296 332 115
|
||||
297 333 114
|
||||
298 334 112
|
||||
299 335 111
|
||||
300 336 110
|
||||
301 337 109
|
||||
302 338 108
|
||||
303 339 107
|
||||
304 341 106
|
||||
305 342 105
|
||||
306 343 104
|
||||
307 344 102
|
||||
308 345 101
|
||||
309 346 100
|
||||
310 347 99
|
||||
311 349 98
|
||||
312 350 97
|
||||
313 351 96
|
||||
314 352 95
|
||||
315 353 93
|
||||
316 354 92
|
||||
317 355 91
|
||||
318 356 90
|
||||
319 357 89
|
||||
320 358 88
|
||||
321 360 87
|
||||
322 361 86
|
||||
323 362 84
|
||||
324 363 83
|
||||
325 364 82
|
||||
326 365 81
|
||||
327 366 80
|
||||
328 367 79
|
||||
329 368 78
|
||||
330 370 77
|
||||
331 371 76
|
||||
332 372 74
|
||||
333 373 73
|
||||
334 374 72
|
||||
335 375 71
|
||||
336 376 70
|
||||
337 378 69
|
||||
338 379 68
|
||||
339 380 67
|
||||
340 381 65
|
||||
341 382 64
|
||||
342 383 63
|
||||
343 384 62
|
||||
344 385 61
|
||||
345 386 60
|
||||
346 387 59
|
||||
347 389 58
|
||||
348 390 57
|
||||
349 391 55
|
||||
350 392 54
|
||||
351 393 53
|
||||
352 394 52
|
||||
353 395 51
|
||||
354 397 50
|
||||
355 398 49
|
||||
356 399 48
|
||||
357 400 46
|
||||
358 401 45
|
||||
359 402 44
|
||||
360 403 43
|
||||
361 404 42
|
||||
362 406 41
|
||||
363 407 40
|
||||
364 408 39
|
||||
365 409 38
|
||||
366 410 36
|
||||
367 411 35
|
||||
368 412 34
|
||||
369 413 33
|
||||
370 414 32
|
||||
371 415 31
|
||||
372 417 30
|
||||
373 418 29
|
||||
374 419 27
|
||||
375 420 26
|
||||
376 421 25
|
||||
377 422 24
|
||||
378 423 23
|
||||
379 424 22
|
||||
380 425 21
|
||||
381 427 20
|
||||
382 428 19
|
||||
383 429 17
|
||||
384 430 16
|
||||
385 431 15
|
||||
386 432 14
|
||||
387 433 13
|
||||
388 434 12
|
||||
389 435 11
|
||||
390 437 10
|
||||
391 438 8
|
||||
392 439 7
|
||||
393 440 6
|
||||
394 441 5
|
||||
395 442 4
|
||||
396 443 3
|
||||
397 444 2
|
||||
398 446 1
|
||||
399 447 0
|
||||
|
@@ -1,181 +0,0 @@
|
||||
# Design notes — why the preprocessing modules do what they do
|
||||
|
||||
Reference for the methodology behind `src/`. The code carries short contract
|
||||
docstrings; the reasoning lives here. Results and model performance are in the
|
||||
top-level [README.md](../README.md); the production contract is in
|
||||
[`production/classifier_symmetric/README.md`](../production/classifier_symmetric/README.md).
|
||||
|
||||
---
|
||||
|
||||
## `config.py` — why whole column families are excluded
|
||||
|
||||
The `hist_*_FN[+-]k`, `*_before_founding` and `*_after_founding` columns are
|
||||
computed relative to a founding event and are **identically zero for every
|
||||
non-founder row** in `datasets_complete`. In RQ1 (full-profile founder vs.
|
||||
non-founder) a model would separate the classes on that artifact rather than on
|
||||
signal, so they are excluded from `RQ1_FEATURE_COLUMNS`.
|
||||
|
||||
`RQ1_PREFOUNDING_PAIRS` handles the opposite direction. For founders, lifetime
|
||||
totals include **post**-founding activity (e.g. continuing to publish part-time
|
||||
after founding) — a reverse-causation confound that lets a model key off a
|
||||
downstream *effect* of founding. Non-founders have no equivalent issue: their
|
||||
full total is inherently "pre-founding". For the four metrics where a validated
|
||||
`_before_founding` split exists, `data._apply_prefounding_equivalent` swaps it in.
|
||||
|
||||
## `data.py` — leakage-safe loading for RQ1 and RQ2
|
||||
|
||||
**RQ1** reads `evaluation/datasets_complete`, drops identifier and leaky columns
|
||||
(`config.RQ1_DROP_COLUMNS`) and keeps the remaining full-career aggregates.
|
||||
|
||||
**RQ2** ("founds within N years") reads the curated 13-column half-profile
|
||||
datasets (`datasets_halfprofiles_offset{1,2,3}`) as the positive class at each
|
||||
horizon, paired with non-founders from `datasets_complete` on the same curated
|
||||
columns, which are legitimate and non-degenerate for non-founders too.
|
||||
|
||||
Non-founders are split 70/30 per institution **once** (fixed `random_state`)
|
||||
into a training pool (offsets 1–3) and a holdout pool reserved exclusively for
|
||||
the offset-3/5 horizon-validation sets, so no individual is ever seen in both
|
||||
training and horizon-generalization testing.
|
||||
|
||||
## `outliers.py` — two-stage multivariate outlier detection
|
||||
|
||||
Replaces the original `publications < 1000` / `patents < 1000` guard inherited
|
||||
from the source notebooks. That guard does remove real rows (677 of them), but
|
||||
the underlying problem is worse than a long tail: several of the most extreme
|
||||
rows — "Hui Zhang" with 20,703 publications and 49,398 patents, "David Smith"
|
||||
with 16,713 publications — are almost certainly **common-name collisions**.
|
||||
Dimensions' name-based researcher matching merges dozens of distinct real people
|
||||
who share a common name into one aggregated profile; these are not genuinely
|
||||
hyper-prolific individuals.
|
||||
|
||||
A single hand-picked threshold on one or two columns cannot reliably separate
|
||||
"very productive but real" from "impossible amalgamation of several people", so
|
||||
outlier handling is two-staged:
|
||||
|
||||
1. A generous, documented **sanity ceiling** — any individual researcher with
|
||||
more than 5,000 lifetime publications or patents is implausible even for
|
||||
extreme large-collaboration physics — to drop flagrant collisions outright.
|
||||
2. An **Isolation Forest** fit in log-space on the remaining rows across the
|
||||
full numeric feature set (not just publications/patents), to catch subtler
|
||||
multivariate anomalies — e.g. an internally inconsistent feature combination
|
||||
that no single-column cutoff would flag.
|
||||
|
||||
## `yearly_counts.py` — per-person, per-year activity from the raw exports
|
||||
|
||||
The raw files in `dimensions_data/` are per-person record lists: each row is one
|
||||
(record × tracked person) pair, keyed by `author_people`. They cover the
|
||||
**founder cohort only** — non-founders were extracted live from the Dimensions
|
||||
API, their per-record data was never saved, and the API key has since expired.
|
||||
|
||||
These exact yearly counts are used two ways:
|
||||
|
||||
1. Exact truncation of founder features at the founding year, replacing the
|
||||
coarser `*_before_founding` splits.
|
||||
2. Fitting the empirical career-trajectory curves in `career_curves.py`, which
|
||||
calibrate the truncation of non-founder lifetime totals at a pseudo-founding
|
||||
year — validated against the founders' exact counts, where both are known.
|
||||
|
||||
**Grants cap.** The `grants` feature counts grant IDs acknowledged on a person's
|
||||
publications, so a single consortium paper can contribute 100+ "grants". The
|
||||
module also emits a capped variant crediting at most `GRANTS_PER_PAPER_CAP`
|
||||
distinct grant IDs per publication, mirroring the hyperauthorship cap in the
|
||||
production profiling module. The empirical distribution of grants per linked
|
||||
paper is p50 = 3, p90 ≈ 6–14 depending on institution, with a consortium tail
|
||||
reaching 409. The cap sits above ordinary multi-grant papers and below the
|
||||
consortium artifacts (~100+/paper) that inflated `grants` roughly 100×.
|
||||
|
||||
## `career_curves.py` — index-date truncation of lifetime totals
|
||||
|
||||
The symmetric redesign needs every person's activity counts **as of an index
|
||||
year** (real founding year for founders, sampled pseudo-founding year for
|
||||
non-founders). Exact per-year records exist only for founders; non-founders have
|
||||
lifetime totals plus first/last activity years.
|
||||
|
||||
We therefore estimate, from the founders' raw trajectories, the average
|
||||
cumulative-share curve
|
||||
|
||||
```
|
||||
F(u) = expected fraction of lifetime output accumulated by career fraction u
|
||||
u = (index_year - first_year) / (last_year + 1 - first_year)
|
||||
```
|
||||
|
||||
separately per activity type (pubs / patents / grants) and career-length
|
||||
stratum, and truncate totals as `total_at_index = total * F(u)`.
|
||||
|
||||
**Critical symmetry rule:** this construction is applied to **both** classes.
|
||||
Founders' exact counts are used only to (a) fit the curves and (b) quantify the
|
||||
approximation error against ground truth (`validate_on_founders`, log-space
|
||||
R² 0.89–0.94). If founders got exact counts while non-founders got smoothed
|
||||
ones, the residual noise texture alone would separate the classes — the exact
|
||||
artifact this redesign removes.
|
||||
|
||||
## `symmetric.py` — the landmark design
|
||||
|
||||
Replaces the asymmetric RQ1/RQ2 preprocessing in `data.py`, where founders'
|
||||
lifetime totals were truncated at their founding year while non-founders kept
|
||||
full-career totals. That made observation-window length a function of the label:
|
||||
the classifier's dominant feature (`publications`) partly encoded the truncation
|
||||
rather than productivity — probability of founding fell monotonically with
|
||||
output, and the 0.918 → 0.976 ROC-AUC "improvement" of the asymmetric fix was a
|
||||
class-separability artifact.
|
||||
|
||||
1. **Index year.** Founders get their cleaned founding year; non-founders a
|
||||
pseudo-founding year sampled from the founders' empirical
|
||||
career-age-at-founding distribution, matched on career-start cohort
|
||||
(landmark / matched index-date design, cf. immortal-time bias).
|
||||
2. **Identical feature construction for both classes**, as deterministic
|
||||
functions of (lifetime totals, first/last activity years, index year) via
|
||||
`career_curves.py`. Founders' exact per-year records are used only to fit and
|
||||
validate those curves — never as a founder-only feature pathway.
|
||||
3. **Citation features excluded** (h-index, i10, g-index, citation sums/means):
|
||||
citations cannot be historicized to the index year for either class, and
|
||||
their full-career values are window-contaminated.
|
||||
4. **`grants` de-inflated** with the per-paper cap from `yearly_counts.py`,
|
||||
applied through a ratio curve so both classes go through the same mapping.
|
||||
|
||||
Two further filters, both applied to **both** classes:
|
||||
|
||||
- **Population definition.** The coach-facing tool scores academics, so the
|
||||
modelled population requires a minimal academic record at the index date
|
||||
(≥ 4 publications). Without it, a sampling-frame clash dominates the
|
||||
thin-profile region: founders come from company databases (people with 1–3
|
||||
lifetime papers included), non-founders from institutional researcher lists
|
||||
(thin profiles underrepresented), making "long career + tiny record" read as
|
||||
65–72% founder. Those people are out of scope for the product, not evidence.
|
||||
- **Plausibility filter.** Profiles with a > 60-year publishing span or a
|
||||
sustained lifetime rate above 25 papers/year are name-collision aggregates
|
||||
(e.g. an "M Nakamura" spanning 1919–2023 with 28k papers). These concentrate
|
||||
in the non-founder class — matched by name alone, vs company + name for
|
||||
founders — so left in they asymmetrically inflate non-founder output.
|
||||
|
||||
## `sequence_data.py` — founder-only sequence dataset
|
||||
|
||||
Task: predict career-relative founding timing from pre-founding activity, using
|
||||
the `hist_{pub,pat,grant}_FN-1..FN-20` columns (chronological yearly counts in
|
||||
the 20 years strictly before founding).
|
||||
|
||||
**Non-founders are not included.** Their equivalent columns are computed with
|
||||
`founded_year` hardcoded to literal year 0 in
|
||||
`extraction/non_founders_scripts.ipynb` (`generate_history(..., nonstartup=True)`
|
||||
forces `founded_year = 0`), so they are all-zero placeholders anchored at
|
||||
1 BCE/1 CE — not real "N years before some reference point" sequences. There is
|
||||
no valid apples-to-apples non-founder sequence in the extracted data; see
|
||||
`experiments/run_sequence_reconstruction_spike.py` for an attempt to build one
|
||||
from the raw per-paper/per-patent data instead.
|
||||
|
||||
**Target:** `founding_age = founded_on (year) - first_publication_year`, i.e.
|
||||
how many years into their publishing career a founder started their company.
|
||||
Only well-posed when `founding_age <= WINDOW` (20): the input window is a fixed
|
||||
20-year lookback, so a longer real pre-founding career would look identical to a
|
||||
≥ 20-year case regardless of the true value. This is a structural
|
||||
right-censoring limit of the fixed window, not a modeling failure, so those rows
|
||||
are excluded from the regression task by default and the excluded count is
|
||||
always reported.
|
||||
|
||||
## `run_rq1_robustness.py` — `scale_pos_weight` under StratifiedKFold
|
||||
|
||||
StratifiedKFold keeps each fold's class ratio approximately equal to the
|
||||
full-data ratio, so a single overall `scale_pos_weight` is a good per-fold
|
||||
approximation for xgboost — which, unlike RF/LightGBM's
|
||||
`class_weight="balanced"`, needs it set explicitly to correct for the ~37%
|
||||
founder rate.
|
||||
@@ -1,149 +0,0 @@
|
||||
name: potential
|
||||
channels:
|
||||
- conda-forge
|
||||
- defaults
|
||||
- https://repo.anaconda.com/pkgs/main
|
||||
- https://repo.anaconda.com/pkgs/r
|
||||
dependencies:
|
||||
- _openmp_mutex=4.5
|
||||
- brotli=1.2.0
|
||||
- brotli-bin=1.2.0
|
||||
- bzip2=1.0.8
|
||||
- ca-certificates=2026.7.22
|
||||
- cairo=1.18.4
|
||||
- contourpy=1.3.3
|
||||
- cpython=3.11.15
|
||||
- cycler=0.12.1
|
||||
- filelock=3.32.2
|
||||
- fmt=12.1.0
|
||||
- font-ttf-dejavu-sans-mono=2.37
|
||||
- font-ttf-inconsolata=3.000
|
||||
- font-ttf-source-code-pro=2.038
|
||||
- font-ttf-ubuntu=0.83
|
||||
- fontconfig=2.18.2
|
||||
- fonts-conda-ecosystem=1
|
||||
- fonts-conda-forge=1
|
||||
- fonttools=4.63.0
|
||||
- freetype=2.14.3
|
||||
- fribidi=1.0.16
|
||||
- fsspec=2026.7.0
|
||||
- gmp=6.3.0
|
||||
- gmpy2=2.3.0
|
||||
- graphite2=1.3.15
|
||||
- icu=78.3
|
||||
- jinja2=3.1.6
|
||||
- joblib=1.5.3
|
||||
- kiwisolver=1.5.0
|
||||
- lcms2=2.19.1
|
||||
- lerc=4.2.0
|
||||
- libabseil=20260526.0
|
||||
- libblas=3.11.0
|
||||
- libbrotlicommon=1.2.0
|
||||
- libbrotlidec=1.2.0
|
||||
- libbrotlienc=1.2.0
|
||||
- libcblas=3.11.0
|
||||
- libcxx=22.1.8
|
||||
- libdeflate=1.25
|
||||
- libexpat=2.8.1
|
||||
- libffi=3.5.2
|
||||
- libfreetype=2.14.3
|
||||
- libfreetype6=2.14.3
|
||||
- libgcc=16.1.0
|
||||
- libgfortran=16.1.0
|
||||
- libgfortran5=16.1.0
|
||||
- libglib=2.88.3
|
||||
- libharfbuzz=14.3.0
|
||||
- libiconv=1.18
|
||||
- libintl=0.25.1
|
||||
- libjpeg-turbo=3.2.0
|
||||
- liblapack=3.11.0
|
||||
- liblzma=5.8.3
|
||||
- libopenblas=0.3.33
|
||||
- libpng=1.6.58
|
||||
- libprotobuf=7.35.1
|
||||
- libraqm=0.11.0
|
||||
- libsqlite=3.53.4
|
||||
- libtiff=4.7.2
|
||||
- libtorch=2.13.0
|
||||
- libuv=1.52.1
|
||||
- libwebp-base=1.6.0
|
||||
- libxcb=1.17.0
|
||||
- libzlib=1.3.2
|
||||
- llvm-openmp=22.1.8
|
||||
- markupsafe=3.0.3
|
||||
- matplotlib=3.11.1
|
||||
- matplotlib-base=3.11.1
|
||||
- mpc=1.4.0
|
||||
- mpfr=4.2.2
|
||||
- munkres=1.1.4
|
||||
- narwhals=2.24.0
|
||||
- ncurses=6.6
|
||||
- networkx=3.6.1
|
||||
- nomkl=1.0
|
||||
- numpy=2.4.6
|
||||
- onednn=3.12
|
||||
- openjpeg=2.5.4
|
||||
- openssl=3.6.3
|
||||
- optree=0.19.1
|
||||
- packaging=26.2
|
||||
- patsy=1.0.2
|
||||
- pcre2=10.47
|
||||
- pillow=12.3.0
|
||||
- pip=26.2
|
||||
- pixman=0.46.4
|
||||
- pthread-stubs=0.4
|
||||
- pybind11=3.0.3
|
||||
- pybind11-abi=11
|
||||
- pybind11-global=3.0.3
|
||||
- pyparsing=3.3.2
|
||||
- python=3.11.15
|
||||
- python-dateutil=2.9.0.post0
|
||||
- python_abi=3.11
|
||||
- pytorch=2.13.0
|
||||
- qhull=2020.2
|
||||
- readline=8.3
|
||||
- scikit-learn=1.9.0
|
||||
- scipy=1.17.1
|
||||
- seaborn=0.13.2
|
||||
- seaborn-base=0.13.2
|
||||
- setuptools=81.0.0
|
||||
- six=1.17.0
|
||||
- sleef=3.9.0
|
||||
- statsmodels=0.14.6
|
||||
- sympy=1.14.0
|
||||
- threadpoolctl=3.6.0
|
||||
- tk=8.6.13
|
||||
- tornado=6.5.7
|
||||
- tqdm=4.70.0
|
||||
- typing-extensions=4.16.0
|
||||
- typing_extensions=4.16.0
|
||||
- unicodedata2=17.0.1
|
||||
- wheel=0.47.0
|
||||
- xorg-libxau=1.0.12
|
||||
- xorg-libxdmcp=1.1.5
|
||||
- zlib-ng=2.3.3
|
||||
- zstd=1.5.7
|
||||
- pip:
|
||||
- autograd==1.9.1
|
||||
- autograd-gamma==0.5.0
|
||||
- catboost==1.2.10
|
||||
- cloudpickle==3.1.2
|
||||
- formulaic==1.2.2
|
||||
- graphviz==0.21
|
||||
- imbalanced-learn==0.14.2
|
||||
- interface-meta==2.0.1
|
||||
- lifelines==0.30.3
|
||||
- lightgbm==4.7.0
|
||||
- llvmlite==0.48.0
|
||||
- mpmath==1.3.0
|
||||
- numba==0.66.0
|
||||
- pandas==2.3.3
|
||||
- plotly==6.9.0
|
||||
- pytz==2026.3.post1
|
||||
- shap==0.51.0
|
||||
- sklearn-compat==0.1.6
|
||||
- slicer==0.0.8
|
||||
- tabulate==0.10.0
|
||||
- tzdata==2026.3
|
||||
- wrapt==2.3.0
|
||||
- xgboost==3.2.0
|
||||
@@ -1,255 +0,0 @@
|
||||
# Founder-Potential Classifier — Production Guide
|
||||
|
||||
Predicts whether a researcher will found a company ("founder" vs. "non-founder")
|
||||
from their **full career profile** (publications, patents, grants, affiliations).
|
||||
This is the RQ1 model from the research pipeline, re-packaged and validated for
|
||||
an OpenAlex + patents + grants production data source.
|
||||
|
||||
## 1. Which two models, and why
|
||||
|
||||
Ranked empirically on the actual production feature set (87 columns — see
|
||||
§3), by PR-AUC on a held-out 20% stratified split (`validated_holdout_metrics.csv`):
|
||||
|
||||
| rank | model | roc_auc | pr_auc | mcc | f1 | notes |
|
||||
|------|----------------------|---------|--------|-------|-------|-------|
|
||||
| 1 | **lightgbm** | 0.9764 | 0.9681 | 0.848 | 0.903 | single model, 1.3 MB, fastest |
|
||||
| 2 | **stacking_ensemble**| 0.9748 | 0.9657 | 0.846 | 0.903 | RF+XGBoost+LightGBM blended by a logistic meta-learner, 29 MB, ~3x slower |
|
||||
| 3 | xgboost | 0.9728 | 0.9640 | 0.843 | 0.900 | close 3rd, not shipped |
|
||||
| 4 | catboost | 0.9710 | 0.9616 | 0.834 | 0.894 | not shipped |
|
||||
|
||||
`lightgbm` and `stacking_ensemble` are shipped in `models/`. They are within
|
||||
noise of each other (Δpr_auc = 0.002); `lightgbm` is recommended as the default
|
||||
for a production system (simpler, smaller, faster, marginally best), with
|
||||
`stacking_ensemble` as a fallback/cross-check if you want a second opinion or
|
||||
slightly better recall (0.905 vs. 0.890).
|
||||
|
||||
## 2. Files
|
||||
|
||||
```
|
||||
production/classifier/
|
||||
founder_classifier.py <- self-contained wrapper (pandas/numpy/joblib only)
|
||||
models/
|
||||
lightgbm.joblib <- recommended default
|
||||
stacking_ensemble.joblib <- alternative / second opinion
|
||||
feature_importance_lightgbm.csv
|
||||
feature_importance_stacking_ensemble.csv
|
||||
validated_holdout_metrics.csv <- honest held-out metrics for every candidate model
|
||||
manifest.json
|
||||
export_classifier.py <- reproducible export/training script
|
||||
```
|
||||
|
||||
Each `.joblib` is a single self-contained bundle: `{model, feature_columns,
|
||||
numeric_columns, log_columns, research_area_columns, research_area_categories,
|
||||
label_meaning}`. You only need `founder_classifier.py` + one `.joblib` file to
|
||||
run predictions — no dependency on the rest of this repository.
|
||||
|
||||
## 3. OpenAlex / production data compatibility
|
||||
|
||||
Your data comes from OpenAlex (publications + author metrics) with patents and
|
||||
grants matched separately to OpenAlex author IDs. Two adjustments were made
|
||||
relative to the original research pipeline, **both validated empirically, no
|
||||
other change to the model was needed**:
|
||||
|
||||
### 3.1 Institution one-hot dropped
|
||||
|
||||
The research dataset one-hot-encodes 8 training institutions. A model trained
|
||||
that way cannot be meaningfully applied to a 9th, unseen institution (its
|
||||
one-hot vector would be all zeros — out of distribution). This production
|
||||
model was trained **without** institution one-hot at all, so it works for any
|
||||
institution, including yours. Cost: ROC-AUC drops from ~0.976 to ~0.95 in a
|
||||
leave-one-institution-out test (see `experiments/README.md` §RQ1) — a modest,
|
||||
worthwhile trade for portability.
|
||||
|
||||
### 3.2 Four Dimensions-specific columns dropped
|
||||
|
||||
| column | what it needs | why it's likely unavailable to you |
|
||||
|---|---|---|
|
||||
| `pat_citation_mean`, `pat_citation_sum` | citation counts **to** each patent | requires a patent source that tracks patent-citing-patent counts (e.g. USPTO/PatentsView citation graph); a simple OpenAlex-author-matched patent list usually won't have this |
|
||||
| `linked_patents_to_publications` | patents that **cite the person's own papers** (non-patent-literature citations) | requires patent-to-paper citation linkage, which most patent sources don't expose |
|
||||
| `grant_innovation_impact` | count of patents **linked to a specific grant** the person received | requires grant-to-patent linkage, on top of grant-to-person matching |
|
||||
|
||||
These were the exact "things we don't have" flagged as a concern. An ablation
|
||||
(same data, same models, same split, only these 4 of 87 columns removed)
|
||||
showed the difference is within noise:
|
||||
|
||||
| feature set | model | roc_auc | pr_auc | mcc |
|
||||
|---|---|---|---|---|
|
||||
| full (includes the 4 columns) | lightgbm | 0.9763 | 0.9685 | 0.8483 |
|
||||
| **without the 4 columns** | lightgbm | 0.9765 | 0.9689 | 0.8514 |
|
||||
| full (includes the 4 columns) | xgboost | 0.9744 | 0.9666 | 0.8426 |
|
||||
| **without the 4 columns** | xgboost | 0.9741 | 0.9657 | 0.8437 |
|
||||
|
||||
Performance doesn't degrade (if anything, it's marginally better without
|
||||
them — consistent with their near-zero permutation importance, see §6). **No
|
||||
architecture/feature-engineering change was made** beyond simply not including
|
||||
these 4 columns — per "if the model can function without it, don't adjust the
|
||||
model," this is confirmed and no further adaptation was necessary.
|
||||
|
||||
### 3.3 Research-area categories
|
||||
|
||||
`publication_research_area`, `patent_research_area`, `grant_research_area` were
|
||||
trained on the first 2 characters of Dimensions' FOR classification codes
|
||||
(e.g. `"3202 Clinical Sciences"` → `"32"`). If your OpenAlex pipeline classifies
|
||||
research area using OpenAlex Topics/Fields/Domains instead, the exact string
|
||||
values will differ. You have two options:
|
||||
1. **Do nothing.** Pass whatever string/code you have; unrecognized values
|
||||
fall into an all-zero ("unknown") one-hot block for that column, which
|
||||
tree models handle gracefully — you just lose the (modest, ~1-2% combined
|
||||
importance, see §6) signal those columns carry.
|
||||
2. **Map your OpenAlex field/domain names to the 2-digit codes** this model
|
||||
was trained on for full signal. The 21 broad codes used are Dimensions
|
||||
FOR 2-digit divisions (30=Agriculture, 31=Biological Sciences, 32=Biomedical
|
||||
and Clinical Sciences, 33=Built Environment and Design, 34=Chemical
|
||||
Sciences, 35=Commerce/Management/Tourism/Services, 36=Creative Arts and
|
||||
Writing, 37=Earth Sciences, 38=Economics, 39=Education, 40=Engineering,
|
||||
41=Environmental Sciences, 42=Health Sciences, 43=History/Heritage/
|
||||
Archaeology, 44=Human Society, 46=Information and Computing Sciences,
|
||||
47=Language/Communication/Culture, 48=Law and Legal Studies,
|
||||
49=Mathematical Sciences, 50=Philosophy and Religious Studies,
|
||||
51=Physical Sciences, 52=Psychology). `"n."` = unknown/not classified.
|
||||
|
||||
Institution and research-area handling aside, **h-index and i10-index are
|
||||
natively provided by OpenAlex** (`summary_stats.h_index` /
|
||||
`summary_stats.i10_index` on the Author object) — you do not need to compute
|
||||
them yourself, despite them being "calculable."
|
||||
|
||||
## 4. Input schema
|
||||
|
||||
Pass a plain dict (or list of dicts for batch) with any subset of these keys —
|
||||
missing numeric keys default to 0, missing categorical keys default to
|
||||
"unknown". **Fields with no natural zero (the year fields, and any field where
|
||||
"0" would be misleading) should always be supplied from real data** — see §7
|
||||
caveats.
|
||||
|
||||
| field | type | description | source |
|
||||
|---|---|---|---|
|
||||
| `h-index` | int | author h-index | OpenAlex `summary_stats.h_index` (native) |
|
||||
| `i10-index` | int | author i10-index | OpenAlex `summary_stats.i10_index` (native) |
|
||||
| `publications` | int | total publication count | OpenAlex `works_count`, or count of that author's works |
|
||||
| `pub_citation_mean` | float | mean citations per publication | mean of `cited_by_count` across the author's works |
|
||||
| `pub_citation_sum` | float | total citations across publications | OpenAlex Author `cited_by_count` (native), or sum of works' `cited_by_count` |
|
||||
| `first_publication_year` | int | year of first publication | min `publication_year` across works |
|
||||
| `last_publication_year` | int | year of most recent publication | max `publication_year` across works |
|
||||
| `patents` | int | total patent count | your patent-matching pipeline |
|
||||
| `first_patent_year` | int | year of first patent | your patent-matching pipeline |
|
||||
| `last_patent_year` | int | year of most recent patent | your patent-matching pipeline |
|
||||
| `grants` | int | total grants/awards count | your grant-matching pipeline (or OpenAlex `awards` on works) |
|
||||
| `first_grant_year` | int | year of first grant | your grant-matching pipeline |
|
||||
| `last_grant_year` | int | year of most recent grant | your grant-matching pipeline |
|
||||
| `affiliations` | int | count of distinct institutional affiliations | OpenAlex Author `affiliations` (native) |
|
||||
| `activities_total` | int | publications + patents + grants | computed (sum) |
|
||||
| `g-index` | int | g-index (largest g s.t. top-g works have ≥ g² combined citations) | computed from per-work `cited_by_count` — see §5 |
|
||||
| `industry_collab_papers` | int | count of publications co-authored with a company-type institution | OpenAlex works' `authorships.institutions.type == "company"` |
|
||||
| `grant_research_impact` | int | count of publications linked to a grant the person received | OpenAlex works' `awards` field, or your grant-to-publication matching |
|
||||
| `publication_research_area` | str | broad research-area code of publications | see §3.3 |
|
||||
| `patent_research_area` | str | broad research-area code of patents | see §3.3 |
|
||||
| `grant_research_area` | str | broad research-area code of grants | see §3.3 |
|
||||
|
||||
Do **not** pass `institution` — it is not used by this model (see §3.1).
|
||||
|
||||
### 5. Computing g-index from OpenAlex
|
||||
|
||||
OpenAlex has no native g-index field. Compute it directly from a list of the
|
||||
person's per-work citation counts (`cited_by_count`), sorted descending:
|
||||
|
||||
```python
|
||||
def g_index(citation_counts: list[int]) -> int:
|
||||
counts = sorted(citation_counts, reverse=True)
|
||||
g = 0
|
||||
cumulative = 0
|
||||
for i, c in enumerate(counts, start=1):
|
||||
cumulative += c
|
||||
if cumulative >= i * i:
|
||||
g = i
|
||||
else:
|
||||
break
|
||||
return g
|
||||
```
|
||||
|
||||
## 6. Output format
|
||||
|
||||
```python
|
||||
clf.predict_one({...})
|
||||
# {'prediction': 1, 'probability_founder': 0.87, 'label': 'founder', 'model': 'lightgbm'}
|
||||
```
|
||||
|
||||
- `prediction`: 0 (non-founder) or 1 (founder), thresholded at `probability_founder >= 0.5`
|
||||
- `probability_founder`: calibrated-ish probability in [0, 1] from `predict_proba`
|
||||
- `label`: human-readable string version of `prediction`
|
||||
|
||||
`clf.predict([...])` (batch) returns a `pandas.DataFrame` with `prediction` and
|
||||
`probability_founder` columns, one row per input record, in input order.
|
||||
|
||||
## 7. Usage example
|
||||
|
||||
```python
|
||||
from founder_classifier import FounderClassifier
|
||||
|
||||
clf = FounderClassifier.load("models/lightgbm.joblib")
|
||||
|
||||
result = clf.predict_one({
|
||||
"h-index": 12, "i10-index": 15, "publications": 40,
|
||||
"pub_citation_mean": 22.5, "pub_citation_sum": 900,
|
||||
"first_publication_year": 2005, "last_publication_year": 2021,
|
||||
"patents": 2, "first_patent_year": 2015, "last_patent_year": 2018,
|
||||
"grants": 3, "first_grant_year": 2010, "last_grant_year": 2019,
|
||||
"affiliations": 2, "activities_total": 45, "g-index": 10,
|
||||
"industry_collab_papers": 4, "grant_research_impact": 5,
|
||||
"publication_research_area": "32", "patent_research_area": "32",
|
||||
"grant_research_area": "32",
|
||||
})
|
||||
print(result)
|
||||
# {'prediction': 1, 'probability_founder': 0.957, 'label': 'founder', 'model': 'lightgbm'}
|
||||
```
|
||||
|
||||
For a second opinion, load `stacking_ensemble.joblib` the same way and compare.
|
||||
|
||||
## 8. Features that affect the classification most
|
||||
|
||||
Permutation importance (mean drop in PR-AUC when a feature is shuffled) on the
|
||||
held-out test split, for both shipped models:
|
||||
|
||||
| feature | lightgbm | stacking_ensemble | OpenAlex availability |
|
||||
|---|---|---|---|
|
||||
| `publications` | **0.494** (dominant) | **0.323** (dominant) | native |
|
||||
| `pub_citation_sum` | 0.100 | 0.069 | computed from works |
|
||||
| `last_patent_year` | 0.089 | 0.081 | your patent pipeline |
|
||||
| `pub_citation_mean` | 0.058 | 0.042 | computed from works |
|
||||
| `i10-index` | 0.058 | 0.035 | native |
|
||||
| `g-index` | 0.039 | 0.035 | computed (§5) |
|
||||
| `activities_total` | 0.023 | 0.021 | computed |
|
||||
| `grants` | 0.023 | 0.019 | your grant pipeline |
|
||||
| `first_publication_year` | 0.016 | 0.015 | native |
|
||||
| `last_publication_year` | 0.010 | — | native |
|
||||
|
||||
**`publications` alone dwarfs every other feature** — by a wide margin, the
|
||||
single most important signal is simply how many papers someone has published.
|
||||
Citation-based signals (`pub_citation_sum`/`mean`, `i10-index`, `g-index`) are
|
||||
a clear second tier. Patent/grant *counts* matter far less than publication
|
||||
volume, and the timing feature `last_patent_year` is surprisingly informative
|
||||
(likely a proxy for "still recently active in applied/patentable work" close
|
||||
to the founding decision). Research-area and institution-adjacent signals are
|
||||
minor (each individual one-hot column contributes < 0.5% importance). Full
|
||||
per-model tables: `feature_importance_lightgbm.csv`,
|
||||
`feature_importance_stacking_ensemble.csv`.
|
||||
|
||||
## 9. Caveats
|
||||
|
||||
- **This is a full-career-profile model** (RQ1): it answers "does this
|
||||
person's overall profile look like a founder's?", not "will they found a
|
||||
company in the next N years?" — for the latter, see the sequence models
|
||||
(`../sequence/README.md`).
|
||||
- **Out-of-distribution inputs are not guarded against.** A record with almost
|
||||
all fields missing/zero is nonsensical (every real researcher has *some*
|
||||
publications) and can produce an unreliable, overconfident prediction —
|
||||
this was observed directly (an all-empty dict predicts "founder" at 99.7%
|
||||
confidence, an artifact of the model extrapolating into a region with no
|
||||
real training examples, not a meaningful result). Only call this model with
|
||||
real profile data for someone who has at least some publication history.
|
||||
- **Retraining on your own labeled data** (once you have enough founder/
|
||||
non-founder examples from your own institution) will likely outperform this
|
||||
model, especially for the research-area categorical signal (§3.3). This
|
||||
model is a strong starting point / cold-start solution before you have your
|
||||
own labels.
|
||||
- Reproduce or retrain via `export_classifier.py` (depends on the full
|
||||
`experiments/src` research package + `evaluation/datasets_complete`).
|
||||
@@ -1,144 +0,0 @@
|
||||
"""Export the two best RQ1 classifiers as standalone production artifacts,
|
||||
adapted for an OpenAlex + patents + grants data pipeline.
|
||||
|
||||
Two adaptations vs `src/data.py::build_rq1_matrix`: the `institution` one-hot is
|
||||
dropped (a model trained on 8 one-hots cannot be applied to a 9th, unseen
|
||||
institution), and four Dimensions-specific columns are dropped as unavailable
|
||||
when patents are matched to OpenAlex authors. Measured cost of each: README.md
|
||||
in this directory, "OpenAlex / production data compatibility".
|
||||
|
||||
Run: conda run -n potential python production/classifier/export_classifier.py
|
||||
(from the experiments/ directory)
|
||||
"""
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import joblib
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
from sklearn.inspection import permutation_importance
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[2]))
|
||||
from src import config, data, evaluate, models, splits # noqa: E402
|
||||
|
||||
OUT_DIR = Path(__file__).resolve().parent
|
||||
MODELS_DIR = OUT_DIR / "models"
|
||||
MODELS_DIR.mkdir(exist_ok=True)
|
||||
|
||||
# Columns dropped for OpenAlex/production compatibility -- see module docstring.
|
||||
UNAVAILABLE_COLUMNS = [
|
||||
"pat_citation_mean",
|
||||
"pat_citation_sum",
|
||||
"linked_patents_to_publications",
|
||||
"grant_innovation_impact",
|
||||
]
|
||||
|
||||
RESEARCH_AREA_COLUMNS = ["publication_research_area", "patent_research_area", "grant_research_area"]
|
||||
|
||||
# The two models to ship, chosen empirically (see rank_production_models below).
|
||||
SHIP_MODELS = ["lightgbm", "stacking_ensemble"]
|
||||
|
||||
|
||||
def build_production_matrix(df):
|
||||
"""Same as data.build_rq1_matrix(include_institution=False) minus the four
|
||||
OpenAlex/production-unavailable columns."""
|
||||
X, y, groups = data.build_rq1_matrix(df, include_institution=False)
|
||||
X = X.drop(columns=UNAVAILABLE_COLUMNS)
|
||||
return X, y, groups
|
||||
|
||||
|
||||
def rank_and_validate(X, y):
|
||||
"""Fit every candidate on a held-out split so we get honest metrics + a
|
||||
permutation importance ranking for the *actual shipped* feature set."""
|
||||
X_train, X_test, y_train, y_test = splits.stratified_holdout(X, y, test_size=0.2)
|
||||
spw = (y_train == 0).sum() / (y_train == 1).sum()
|
||||
candidates = {
|
||||
**models.advanced_models(scale_pos_weight=spw),
|
||||
"stacking_ensemble": models.stacking_model(scale_pos_weight=spw),
|
||||
}
|
||||
rows, fitted = [], {}
|
||||
for name, model in candidates.items():
|
||||
model, metrics, pred, proba = evaluate.fit_and_evaluate(model, X_train, y_train, X_test, y_test)
|
||||
rows.append({"model": name, **metrics})
|
||||
fitted[name] = model
|
||||
table = evaluate.results_table(rows, sort_by="pr_auc")
|
||||
print("Validated performance (held-out 20% split, production feature set):")
|
||||
print(table[["accuracy", "precision", "recall", "f1", "roc_auc", "pr_auc", "mcc"]])
|
||||
table.to_csv(OUT_DIR / "validated_holdout_metrics.csv")
|
||||
|
||||
# Permutation importance for each shipped model on the held-out split.
|
||||
importances = {}
|
||||
for name in SHIP_MODELS:
|
||||
result = permutation_importance(
|
||||
fitted[name], X_test, y_test, n_repeats=20, random_state=config.RANDOM_STATE, scoring="average_precision"
|
||||
)
|
||||
imp_df = pd.DataFrame(
|
||||
{"feature": X.columns, "importance_mean": result.importances_mean, "importance_std": result.importances_std}
|
||||
).sort_values("importance_mean", ascending=False)
|
||||
imp_df.to_csv(OUT_DIR / f"feature_importance_{name}.csv", index=False)
|
||||
importances[name] = imp_df
|
||||
print(f"\nTop 10 features for {name} (permutation importance, PR-AUC drop):")
|
||||
print(imp_df.head(10).to_string(index=False))
|
||||
return table, importances
|
||||
|
||||
|
||||
def fit_final_bundles(X, y):
|
||||
"""Refit each shipped model on ALL available labeled data (standard practice
|
||||
for a deployed artifact -- validated metrics above already establish that
|
||||
generalization performance holds up on unseen individuals/institutions)."""
|
||||
spw = (y == 0).sum() / (y == 1).sum()
|
||||
candidates = {
|
||||
**models.advanced_models(scale_pos_weight=spw),
|
||||
"stacking_ensemble": models.stacking_model(scale_pos_weight=spw),
|
||||
}
|
||||
numeric_columns = [c for c in config.RQ1_NUMERIC_COLUMNS if c not in UNAVAILABLE_COLUMNS]
|
||||
# Persist the *actual* categories seen at training time for each research-area
|
||||
# column (needed to reindex one-hot columns identically at inference time).
|
||||
raw_df = data.load_rq1_raw()
|
||||
broad_categories = {
|
||||
col: sorted(data._broad_research_area(raw_df[col]).unique().tolist()) for col in RESEARCH_AREA_COLUMNS
|
||||
}
|
||||
|
||||
for name in SHIP_MODELS:
|
||||
model = candidates[name]
|
||||
model.fit(X, y)
|
||||
bundle = {
|
||||
"model": model,
|
||||
"model_name": name,
|
||||
"feature_columns": X.columns.tolist(),
|
||||
"numeric_columns": numeric_columns,
|
||||
"log_columns": [c for c in config.RQ1_LOG_COLUMNS if c not in UNAVAILABLE_COLUMNS],
|
||||
"research_area_columns": RESEARCH_AREA_COLUMNS,
|
||||
"research_area_categories": broad_categories,
|
||||
"label_meaning": {0: "non-founder", 1: "founder"},
|
||||
}
|
||||
out_path = MODELS_DIR / f"{name}.joblib"
|
||||
joblib.dump(bundle, out_path)
|
||||
print(f"Saved {out_path} ({out_path.stat().st_size / 1024:.0f} KB)")
|
||||
|
||||
|
||||
def main():
|
||||
raw_df = data.load_rq1_raw()
|
||||
X, y, _ = build_production_matrix(raw_df)
|
||||
print(f"Production feature matrix: {X.shape[0]} rows x {X.shape[1]} columns\n")
|
||||
|
||||
table, importances = rank_and_validate(X, y)
|
||||
top2 = table.index[:2].tolist()
|
||||
print(f"\nTop-2 by PR-AUC on production feature set: {top2}")
|
||||
|
||||
fit_final_bundles(X, y)
|
||||
|
||||
manifest = {
|
||||
"shipped_models": SHIP_MODELS,
|
||||
"feature_count": X.shape[1],
|
||||
"unavailable_columns_dropped": UNAVAILABLE_COLUMNS,
|
||||
"institution_onehot_dropped": True,
|
||||
}
|
||||
with open(OUT_DIR / "manifest.json", "w") as f:
|
||||
json.dump(manifest, f, indent=2)
|
||||
print("\nDone.")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,88 +0,0 @@
|
||||
feature,importance_mean,importance_std
|
||||
publications,0.49372270392208406,0.009435105555281502
|
||||
pub_citation_sum,0.10041155476971034,0.003075116147541558
|
||||
last_patent_year,0.08897556673923894,0.00369039716968687
|
||||
pub_citation_mean,0.05843840173995631,0.0035635258840383387
|
||||
i10-index,0.058276972447521766,0.0028493921400149316
|
||||
g-index,0.03926107174812248,0.002908392365462608
|
||||
activities_total,0.02269603064081724,0.0014262023325240447
|
||||
grants,0.022629143919601975,0.0018617301145260297
|
||||
first_publication_year,0.016383482397344773,0.0014781488366511484
|
||||
last_publication_year,0.01044333199563966,0.0012914478475198282
|
||||
last_grant_year,0.008814204773467744,0.0006485422255609053
|
||||
patents,0.007948968544722036,0.00072369450238458
|
||||
publication_research_area_32,0.004622593405503084,0.0005567329882739705
|
||||
industry_collab_papers,0.004127688678751134,0.0005178389595278936
|
||||
affiliations,0.0038678024032746117,0.0006972880130649415
|
||||
first_patent_year,0.003812250467041056,0.000739110083304315
|
||||
first_grant_year,0.0030673049491659722,0.0005750427084734693
|
||||
h-index,0.0026992385419333962,0.00038040011240434297
|
||||
grant_research_area_32,0.0024383846686938824,0.0006597174523401329
|
||||
grant_research_impact,0.002092380085101797,0.0009209829823855754
|
||||
patent_research_area_46,0.0015450646662926114,0.0003408238801588627
|
||||
publication_research_area_46,0.0011186842180353428,0.0003636648316547925
|
||||
publication_research_area_31,0.0007689503487253891,0.0003229045550739315
|
||||
publication_research_area_35,0.000357006395234688,0.000184261296332344
|
||||
patent_research_area_35,0.0003289822271172027,0.0002457177044892662
|
||||
grant_research_area_46,0.0003235675420170059,0.00012528589983147148
|
||||
patent_research_area_32,0.000284992232621617,9.07382535848989e-05
|
||||
publication_research_area_42,0.00017982554980572885,0.00010724763462688804
|
||||
publication_research_area_51,0.00015147606865889007,0.00017482583322384033
|
||||
publication_research_area_33,0.00014482998247801194,0.00014293663951790765
|
||||
publication_research_area_44,0.0001390054811560959,5.095898280286692e-05
|
||||
grant_research_area_42,0.00010679798913335037,0.00011517614876712806
|
||||
publication_research_area_52,7.58659457399391e-05,8.67872358194002e-05
|
||||
publication_research_area_n.,3.733479496259573e-05,8.266304276802761e-05
|
||||
publication_research_area_47,3.577968510939944e-05,3.644548262290321e-05
|
||||
grant_research_area_33,2.7053741977389746e-05,1.3158619878764252e-05
|
||||
publication_research_area_39,2.6107088659182988e-05,5.314752896673858e-05
|
||||
patent_research_area_40,2.293468269031207e-05,5.522677589407406e-05
|
||||
publication_research_area_30,2.1227363888909333e-05,4.0118754214761545e-05
|
||||
grant_research_area_52,1.86106929250307e-05,4.737938770158699e-05
|
||||
grant_research_area_31,1.7230231395626296e-05,3.303598252316633e-05
|
||||
grant_research_area_36,1.5591805886239208e-05,1.4155029297892755e-05
|
||||
grant_research_area_34,1.5538090563826935e-05,6.936899814614872e-05
|
||||
grant_research_area_51,1.516446191183185e-05,5.6983277869360076e-05
|
||||
publication_research_area_36,1.4576087392986769e-05,2.765828911048998e-05
|
||||
patent_research_area_34,1.2943329198150666e-05,3.9589156048043156e-05
|
||||
publication_research_area_40,1.0268854792233605e-05,0.00010816661742277235
|
||||
patent_research_area_31,7.878647505654702e-06,2.0077897722361337e-05
|
||||
grant_research_area_30,2.291815734967173e-06,4.65029322854696e-06
|
||||
publication_research_area_38,1.9069228478219014e-06,8.771931389052964e-05
|
||||
patent_research_area_41,6.061759097786279e-07,9.166702390722687e-06
|
||||
publication_research_area_43,2.6636266048374323e-08,1.1610479193812715e-07
|
||||
grant_research_area_37,0.0,0.0
|
||||
grant_research_area_49,0.0,0.0
|
||||
grant_research_area_50,0.0,0.0
|
||||
grant_research_area_43,0.0,0.0
|
||||
grant_research_area_44,0.0,0.0
|
||||
patent_research_area_52,0.0,0.0
|
||||
grant_research_area_47,0.0,0.0
|
||||
grant_research_area_48,0.0,0.0
|
||||
grant_research_area_38,0.0,0.0
|
||||
patent_research_area_47,0.0,0.0
|
||||
patent_research_area_39,0.0,0.0
|
||||
patent_research_area_38,0.0,0.0
|
||||
patent_research_area_50,0.0,0.0
|
||||
patent_research_area_49,0.0,0.0
|
||||
patent_research_area_48,0.0,0.0
|
||||
patent_research_area_33,0.0,0.0
|
||||
patent_research_area_44,0.0,0.0
|
||||
patent_research_area_43,0.0,0.0
|
||||
patent_research_area_42,0.0,0.0
|
||||
publication_research_area_50,0.0,0.0
|
||||
patent_research_area_36,0.0,0.0
|
||||
patent_research_area_37,0.0,0.0
|
||||
publication_research_area_48,0.0,0.0
|
||||
grant_research_area_35,-1.417609221954219e-07,6.811830057220157e-06
|
||||
patent_research_area_30,-2.1125354582318678e-07,5.786182703937211e-06
|
||||
publication_research_area_41,-3.4822477430085376e-06,5.216332045233262e-05
|
||||
grant_research_area_40,-3.6317530620000316e-06,1.3350040147139044e-05
|
||||
publication_research_area_34,-3.646016761565951e-06,7.33822378850038e-05
|
||||
grant_research_area_39,-7.1453723731962345e-06,7.890200374144198e-06
|
||||
publication_research_area_49,-1.1344775302907229e-05,8.151635605591815e-06
|
||||
patent_research_area_51,-1.6526341596556638e-05,1.1059230863873912e-05
|
||||
patent_research_area_n.,-2.1720602983060776e-05,7.506139221086442e-05
|
||||
publication_research_area_37,-2.9818072529441686e-05,1.7457265886226128e-05
|
||||
grant_research_area_n.,-4.7040468339543115e-05,0.00011100424284573038
|
||||
grant_research_area_41,-0.0001130957822619516,2.660738658933989e-05
|
||||
|
@@ -1,88 +0,0 @@
|
||||
feature,importance_mean,importance_std
|
||||
publications,0.3230278846487044,0.008800711081034392
|
||||
last_patent_year,0.08101404353937798,0.003480354323912183
|
||||
pub_citation_sum,0.06944573429242025,0.0023742502139718533
|
||||
pub_citation_mean,0.04195885153037786,0.002746357604547681
|
||||
i10-index,0.03509514754261644,0.002072326739488329
|
||||
g-index,0.03475697537302609,0.0027920726906895555
|
||||
activities_total,0.020832913783627394,0.0014390050076316802
|
||||
grants,0.019315451629353792,0.001705491344778238
|
||||
first_publication_year,0.01533644702358411,0.001435861122416683
|
||||
patents,0.008735459919303962,0.0008664045277148187
|
||||
last_grant_year,0.00852538114821349,0.0008305351559872533
|
||||
last_publication_year,0.008331716857098981,0.0011919353376131424
|
||||
first_patent_year,0.004574821675796192,0.0008880825668646626
|
||||
publication_research_area_32,0.004441482221912802,0.0005572418844014392
|
||||
industry_collab_papers,0.003930523472063801,0.0005518946751113055
|
||||
affiliations,0.0030599567623114943,0.0010611086743104593
|
||||
h-index,0.0022261144135681645,0.0005336009903611933
|
||||
first_grant_year,0.001877805851533959,0.0005896264410466552
|
||||
grant_research_impact,0.0016329087316583224,0.0008953253954886791
|
||||
patent_research_area_46,0.0014940981662886431,0.00037841991074793763
|
||||
publication_research_area_46,0.0011952487055542527,0.00034735364248049394
|
||||
grant_research_area_32,0.0010669398974483101,0.0005455308275487198
|
||||
publication_research_area_31,0.0007084035131517119,0.00039455107739638177
|
||||
patent_research_area_32,0.0004949758173996676,0.00013130610768396822
|
||||
publication_research_area_35,0.0003405892771618013,0.00018230752010422918
|
||||
patent_research_area_35,0.00024248321741005552,0.00020196690479766595
|
||||
grant_research_area_46,0.00023508021158918924,9.949654281666699e-05
|
||||
patent_research_area_31,0.00018850830793534779,1.8256292436730253e-05
|
||||
publication_research_area_42,0.0001534410024302102,0.00011124851671888089
|
||||
publication_research_area_51,0.00014695613247396323,0.0001875329044078893
|
||||
publication_research_area_33,0.00013417272910902777,0.00013187331917677777
|
||||
publication_research_area_44,0.00012981751828511912,5.6292634597364995e-05
|
||||
grant_research_area_42,5.536599990074165e-05,9.314538927088949e-05
|
||||
publication_research_area_52,4.569653237913584e-05,7.131642881143011e-05
|
||||
grant_research_area_31,4.1136563865012964e-05,2.3807980697386147e-05
|
||||
patent_research_area_n.,3.185352984812484e-05,0.00011635744728257203
|
||||
publication_research_area_39,2.6622233316087042e-05,5.5811212973079166e-05
|
||||
grant_research_area_51,2.4725683306386914e-05,6.600893864529117e-05
|
||||
publication_research_area_47,2.433370482673447e-05,3.423391460291853e-05
|
||||
patent_research_area_40,1.8682066021558085e-05,8.373831667931168e-05
|
||||
grant_research_area_52,1.736850855706962e-05,4.3586661490832724e-05
|
||||
grant_research_area_33,1.5434425911642348e-05,7.2096436009871756e-06
|
||||
publication_research_area_36,1.4747622070127031e-05,2.0277087228790355e-05
|
||||
grant_research_area_36,1.142451025916702e-05,6.434576027802877e-06
|
||||
patent_research_area_34,8.701666157134858e-06,5.019098976931235e-05
|
||||
grant_research_area_44,4.732059862427862e-06,7.2140691084721474e-06
|
||||
grant_research_area_37,4.64755563436281e-06,5.030937947155093e-07
|
||||
patent_research_area_41,2.4010968401655396e-06,5.567934448611626e-06
|
||||
patent_research_area_30,1.6321848824496498e-06,5.780242227170541e-06
|
||||
publication_research_area_38,9.905339116711431e-07,8.061592993393422e-05
|
||||
grant_research_area_30,9.659275313156358e-07,2.7523076304409766e-06
|
||||
publication_research_area_43,5.303685287838533e-07,1.367136262691942e-07
|
||||
patent_research_area_49,4.579606428523064e-07,0.0
|
||||
patent_research_area_37,3.063681887460756e-07,1.7298092956127215e-06
|
||||
grant_research_area_43,2.3512457243968222e-07,8.230462484551701e-07
|
||||
grant_research_area_38,2.3508913500336347e-07,8.200887763327234e-07
|
||||
grant_research_area_48,5.8234010574809145e-08,9.530097523591368e-07
|
||||
patent_research_area_33,3.072036073303863e-08,2.2691555351810873e-07
|
||||
publication_research_area_48,1.7983012212674508e-08,2.2325824775832636e-07
|
||||
patent_research_area_36,1.7241796396172405e-08,7.515524809601928e-08
|
||||
publication_research_area_50,6.931049512104437e-10,3.8784698331014374e-07
|
||||
grant_research_area_47,0.0,0.0
|
||||
patent_research_area_44,0.0,0.0
|
||||
patent_research_area_52,0.0,0.0
|
||||
patent_research_area_50,0.0,0.0
|
||||
patent_research_area_38,0.0,0.0
|
||||
patent_research_area_39,0.0,0.0
|
||||
patent_research_area_43,0.0,0.0
|
||||
patent_research_area_47,-1.1949865169613717e-08,3.48654680192657e-07
|
||||
grant_research_area_50,-2.1918295900480445e-08,3.3714424966572567e-07
|
||||
grant_research_area_49,-8.055305700249704e-08,1.891835873709255e-07
|
||||
patent_research_area_48,-4.387378193082547e-07,1.0065335879337318e-07
|
||||
grant_research_area_35,-1.4239535029381135e-06,8.577025403596155e-06
|
||||
grant_research_area_40,-2.8211226388352716e-06,5.5951614108796825e-06
|
||||
patent_research_area_42,-3.3309781069246203e-06,1.8056260442298824e-06
|
||||
patent_research_area_51,-6.034520616637895e-06,9.657390477461269e-06
|
||||
grant_research_area_34,-6.555808500358085e-06,5.834666117024457e-05
|
||||
publication_research_area_30,-6.9231426525317994e-06,2.3604223992407287e-05
|
||||
grant_research_area_39,-7.033697191549671e-06,4.692880133162641e-06
|
||||
publication_research_area_41,-1.6315314521198056e-05,3.6394138064735864e-05
|
||||
publication_research_area_49,-2.0970323580088435e-05,1.491599600665608e-05
|
||||
publication_research_area_37,-2.4155344697468494e-05,1.268437871622249e-05
|
||||
publication_research_area_40,-2.4661278046128608e-05,9.362093188879351e-05
|
||||
publication_research_area_34,-4.671501475140283e-05,6.79190773369875e-05
|
||||
grant_research_area_n.,-6.528496794626637e-05,0.00033896991853285866
|
||||
grant_research_area_41,-8.826418872341368e-05,2.1901303480798616e-05
|
||||
publication_research_area_n.,-8.850450506823205e-05,0.00012674501058303883
|
||||
|
@@ -1,109 +0,0 @@
|
||||
"""Self-contained inference wrapper for the founder-potential classifier.
|
||||
|
||||
Depends only on pandas, numpy and joblib -- no dependency on the `experiments/src`
|
||||
research package, so this file + a `models/*.joblib` bundle can be copied into any
|
||||
other codebase.
|
||||
|
||||
Usage:
|
||||
from founder_classifier import FounderClassifier
|
||||
|
||||
clf = FounderClassifier.load("models/lightgbm.joblib")
|
||||
result = clf.predict_one({
|
||||
"h-index": 12, "i10-index": 15, "publications": 40,
|
||||
"pub_citation_mean": 22.5, "pub_citation_sum": 900,
|
||||
"first_publication_year": 2005, "last_publication_year": 2021,
|
||||
"patents": 2, "first_patent_year": 2015, "last_patent_year": 2018,
|
||||
"grants": 3, "first_grant_year": 2010, "last_grant_year": 2019,
|
||||
"affiliations": 2, "activities_total": 45, "g-index": 10,
|
||||
"industry_collab_papers": 4, "grant_research_impact": 5,
|
||||
"publication_research_area": "32", "patent_research_area": "32",
|
||||
"grant_research_area": "32",
|
||||
})
|
||||
print(result) # {'prediction': 1, 'probability_founder': 0.87, ...}
|
||||
|
||||
See README.md in this directory for the full input schema and output format.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
import joblib
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
|
||||
|
||||
class FounderClassifier:
|
||||
"""Wraps a fitted sklearn/LightGBM classifier bundle produced by
|
||||
`export_classifier.py`, handling feature preprocessing (log1p transforms +
|
||||
research-area one-hot encoding) so callers can pass plain feature dicts."""
|
||||
|
||||
def __init__(self, bundle: dict[str, Any]):
|
||||
self._model = bundle["model"]
|
||||
self.model_name: str = bundle["model_name"]
|
||||
self.feature_columns: list[str] = bundle["feature_columns"]
|
||||
self.numeric_columns: list[str] = bundle["numeric_columns"]
|
||||
self.log_columns: list[str] = bundle["log_columns"]
|
||||
self.research_area_columns: list[str] = bundle["research_area_columns"]
|
||||
self.research_area_categories: dict[str, list[str]] = bundle["research_area_categories"]
|
||||
|
||||
@classmethod
|
||||
def load(cls, path: str | Path) -> "FounderClassifier":
|
||||
return cls(joblib.load(path))
|
||||
|
||||
# -- preprocessing -----------------------------------------------------
|
||||
@staticmethod
|
||||
def _broad_research_area(value: Any) -> str:
|
||||
"""Collapse a research-area code to its 2-character broad category,
|
||||
matching the training-time `data._broad_research_area` transform."""
|
||||
if value is None or (isinstance(value, float) and np.isnan(value)):
|
||||
return "n."
|
||||
return str(value).strip()[:2]
|
||||
|
||||
def _to_frame(self, records: list[dict[str, Any]]) -> pd.DataFrame:
|
||||
df = pd.DataFrame.from_records(records, index=range(len(records)))
|
||||
|
||||
# Missing numeric/categorical columns default to 0 / "n." (matches
|
||||
# training-time fillna(0) for any column that couldn't be parsed as
|
||||
# numeric, and the "n.a." fallback in data._broad_research_area).
|
||||
for col in self.numeric_columns:
|
||||
if col not in df.columns:
|
||||
df[col] = 0
|
||||
numeric = df[self.numeric_columns].apply(pd.to_numeric, errors="coerce").fillna(0)
|
||||
for col in self.log_columns:
|
||||
numeric[col] = np.log1p(numeric[col].clip(lower=0))
|
||||
|
||||
for col in self.research_area_columns:
|
||||
if col not in df.columns:
|
||||
df[col] = None
|
||||
cat_df = pd.DataFrame(
|
||||
{col: df[col].apply(self._broad_research_area) for col in self.research_area_columns}
|
||||
)
|
||||
categorical = pd.get_dummies(cat_df, prefix=cat_df.columns.tolist())
|
||||
|
||||
X = pd.concat([numeric, categorical], axis=1)
|
||||
# Reindex to the exact training-time column order; any research-area
|
||||
# category not seen during training (or missing here) becomes all-zero
|
||||
# for that one-hot block, which tree models handle gracefully.
|
||||
X = X.reindex(columns=self.feature_columns, fill_value=0)
|
||||
return X
|
||||
|
||||
# -- public API ----------------------------------------------------------
|
||||
def predict(self, records: list[dict[str, Any]]) -> pd.DataFrame:
|
||||
"""Batch prediction. `records` is a list of raw feature dicts (see
|
||||
README for the input schema). Returns a DataFrame with one row per
|
||||
input record: `prediction` (0/1) and `probability_founder` (0-1)."""
|
||||
X = self._to_frame(records)
|
||||
proba = self._model.predict_proba(X)[:, 1]
|
||||
pred = (proba >= 0.5).astype(int)
|
||||
return pd.DataFrame({"prediction": pred, "probability_founder": proba})
|
||||
|
||||
def predict_one(self, record: dict[str, Any]) -> dict[str, Any]:
|
||||
"""Single-record convenience wrapper around `predict`."""
|
||||
row = self.predict([record]).iloc[0]
|
||||
return {
|
||||
"prediction": int(row["prediction"]),
|
||||
"probability_founder": float(row["probability_founder"]),
|
||||
"label": "founder" if row["prediction"] == 1 else "non-founder",
|
||||
"model": self.model_name,
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"shipped_models": [
|
||||
"lightgbm",
|
||||
"stacking_ensemble"
|
||||
],
|
||||
"feature_count": 87,
|
||||
"unavailable_columns_dropped": [
|
||||
"pat_citation_mean",
|
||||
"pat_citation_sum",
|
||||
"linked_patents_to_publications",
|
||||
"grant_innovation_impact"
|
||||
],
|
||||
"institution_onehot_dropped": true
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
model,accuracy,precision,recall,f1,roc_auc,pr_auc,mcc,brier
|
||||
lightgbm,0.9293725371324644,0.9161016949152543,0.8897119341563786,0.902713987473904,0.9763933319115661,0.9680867355662728,0.8475189762274824,0.05343925129722402
|
||||
stacking_ensemble,0.9284631706577751,0.9009009009009009,0.9053497942386831,0.90311986863711,0.9748029272608074,0.9657412183896399,0.8464233584967953,0.05796028500367217
|
||||
xgboost,0.927250682024856,0.9079497907949791,0.8930041152263375,0.9004149377593361,0.9728476023474957,0.9640546196916957,0.8431866284933476,0.05821008235216141
|
||||
catboost,0.9227038496514095,0.8993344425956739,0.8897119341563786,0.8944973107157633,0.9709767935988879,0.9616152397971783,0.833539926599779,0.061886894004821225
|
||||
random_forest,0.8911791451955138,0.8639455782312925,0.8362139917695474,0.849853617733166,0.9489078062921099,0.9295025250699936,0.764805465144283,0.09198073526810191
|
||||
svm_rbf,0.8742043043346469,0.8424657534246576,0.8098765432098766,0.8258497691984893,0.9312032495280522,0.8989506133295394,0.7277986141772655,0.09551038087976692
|
||||
|
@@ -1,97 +0,0 @@
|
||||
# Founder classifier v2 (symmetric landmark design)
|
||||
|
||||
Replaces `../classifier` (v1). **v1 must not be used for ranking or coaching:**
|
||||
it was trained with asymmetric observation windows (founders truncated at
|
||||
founding, non-founders full-career) and behaves as an inverse-productivity
|
||||
score in production — 1 publication → P(founder)=0.996, 800 → 0.0002. Its
|
||||
0.976 ROC-AUC was inflated by window-length leakage, and the companion
|
||||
`p_within_3y`/`p_within_5y` outputs were degenerate (exactly 1.0 for every
|
||||
author).
|
||||
|
||||
## What changed
|
||||
|
||||
| | v1 (asymmetric) | v2 (symmetric) |
|
||||
|---|---|---|
|
||||
| Observation window | founders truncated at founding; non-founders full career | every person truncated at an index year (real founding / cohort-matched pseudo-founding), identical construction for both classes |
|
||||
| Citation features (h-index, i10, g-index, citation sums) | included, window-contaminated | excluded — not historicizable to an index date |
|
||||
| `grants` | raw (consortium lists inflate ~100×, up to 409 grants/paper) | de-inflated via per-paper cap mapping (cap 10), applied inside the wrapper |
|
||||
| Institution one-hots | included | excluded — production scores people from arbitrary institutions |
|
||||
| Population | anyone matched | academics only: ≥4 publications at index (both classes), plausibility-filtered (see below) |
|
||||
| Headline holdout | ROC-AUC 0.976 / PR-AUC 0.969 (artifact) | ROC-AUC 0.874 / PR-AUC 0.726 (honest); temporal-split PR-AUC ≈0.73; 5-fold OOF 0.866/0.726 |
|
||||
| P(founder) vs output | strictly decreasing, incl. absurd tail (1 pub → 0.996) | plateau ~0.39–0.42 for 5–17 pubs at index, ~0.10–0.18 for 100+ (matches empirical label rates) |
|
||||
| p_within_{1,3,5}y | 3y/5y ≡ 1.0 for everyone | all horizons discriminate (ROC-AUC 0.86–0.89; ≤0.1% of scores above 0.99) |
|
||||
| Coach-facing number | raw probability | **percentile** vs the ~9k-academic reference cohort, with an out-of-population guard |
|
||||
|
||||
Two dataset artifacts beyond the window asymmetry were found and filtered
|
||||
during the rebuild, both class-asymmetric (rules applied to BOTH classes):
|
||||
|
||||
- **Sampling-frame clash on thin profiles.** Founders come from company
|
||||
databases (people with 1–3 lifetime papers included); non-founders from
|
||||
institutional researcher lists (thin profiles underrepresented). Left in,
|
||||
"long career + tiny record" reads as 65–72% founder. Hence the ≥4
|
||||
publications population rule, enforced at inference by `in_population`.
|
||||
- **Name-collision aggregates.** Non-founders matched by name alone merge
|
||||
multiple researchers (e.g. an "M Nakamura" spanning 1919–2023 with 28,050
|
||||
papers); 4.2% of non-founders vs 2.2% of founders had physically impossible
|
||||
profiles (>60-year span or >25 papers/year sustained). These rows are
|
||||
dropped.
|
||||
|
||||
Training details: `experiments/docs/DESIGN_NOTES.md` (design rationale), `experiments/src/symmetric.py`,
|
||||
`experiments/run_rq1_symmetric.py`, `experiments/run_rq2_symmetric.py`;
|
||||
results in `experiments/results/rq1_symmetric` and `rq2_symmetric`.
|
||||
|
||||
## Interpreting the outputs
|
||||
|
||||
- `percentile` (0–100): rank of the person's score against out-of-fold scores
|
||||
of the reference cohort (founders + non-founders from the 8 training
|
||||
institutions). This is the number to surface to coaches ("higher founding
|
||||
propensity than X% of comparable academics").
|
||||
- `probability_founder` (0–1): raw case-control model output. The training
|
||||
cohort is ~26% founders — far above any real-world base rate — so this is
|
||||
NOT a population founding probability. Do not display it as one.
|
||||
- `p_within_{k}y` bundles: same construction at index−k; conditional-timing
|
||||
evidence, same percentile caveat.
|
||||
|
||||
## Input contract (per record)
|
||||
|
||||
Lifetime totals **as of `scoring_year`** (for live profiles: the current year):
|
||||
`publications`, `patents`, `grants` (raw — the wrapper de-inflates),
|
||||
`first_publication_year`, `first_patent_year`, `first_grant_year`,
|
||||
`industry_collab_papers`, `linked_patents_to_publications`,
|
||||
`publication_research_area`, `patent_research_area`, `grant_research_area`.
|
||||
Missing fields default to 0 / "n.a.". Citation fields are accepted but ignored.
|
||||
|
||||
```python
|
||||
from founder_classifier_v2 import FounderClassifierV2
|
||||
clf = FounderClassifierV2.load("models/founder_classifier_v2.joblib")
|
||||
clf.predict_one({...}, scoring_year=2026)
|
||||
```
|
||||
|
||||
## Migrating smart-guide `profiling/multipliers/founding.py`
|
||||
|
||||
1. Copy this directory (wrapper + `models/*.joblib`) next to the v1 classifier.
|
||||
2. Point the classifier loader at `founder_classifier_v2.joblib` and pass
|
||||
`scoring_year` (extraction snapshot year).
|
||||
3. Surface `percentile` as `founding.percentile`; keep `probability_founder`
|
||||
internal. Replace the degenerate `p_within_3y/5y` fields with the v2
|
||||
bundles' outputs.
|
||||
4. Remove the README stop-block once v1 is no longer referenced.
|
||||
|
||||
## Known limitations (documented, not hidden)
|
||||
|
||||
- Non-founder historical snapshots are curve-estimates (empirical career
|
||||
curves fitted on founders' raw per-year records; log-space R² 0.89–0.94 vs
|
||||
ground truth), because non-founders' per-record data was never saved and the
|
||||
Dimensions API key is dead. Founders' snapshots use the same construction so
|
||||
fidelity is class-symmetric.
|
||||
- Pseudo-founding years for non-founders are sampled (seeded) from the
|
||||
founders' career-age-at-founding distribution, cohort-matched by decade of
|
||||
first publication.
|
||||
- Reference cohort is 8 research universities, index years ≈1950–2023; scoring
|
||||
profiles far outside that population extrapolates.
|
||||
- Conditional on career age, the score declines with publication volume beyond
|
||||
~20–40 papers at index (hyper-prolific researchers found less in this
|
||||
cohort). The empirical label rates support it after cleaning, but residual
|
||||
moderate name-collisions in the non-founder class could still contribute.
|
||||
Communicate to coaches as "the model favours focused mid-volume researchers",
|
||||
and treat very-high-output percentiles as conservative.
|
||||
@@ -1,99 +0,0 @@
|
||||
"""Export the symmetric founder classifier as a self-contained v2 bundle.
|
||||
|
||||
Produces models/founder_classifier_v2.joblib (and p_within_{k}y bundles) with:
|
||||
- the final model refit on the full symmetric dataset;
|
||||
- preprocessing metadata (feature order, log columns, research-area columns);
|
||||
- the grants de-inflation mapping fitted on raw founder records;
|
||||
- reference score quantiles for percentile ranking, computed from 5-fold
|
||||
OUT-OF-FOLD predictions (in-sample scores would shift live percentiles).
|
||||
|
||||
Run with: conda run -n potential python experiments/production/classifier_symmetric/export_classifier_v2.py
|
||||
"""
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import joblib
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
from sklearn.model_selection import StratifiedKFold, cross_val_predict
|
||||
|
||||
HERE = Path(__file__).resolve().parent
|
||||
sys.path.insert(0, str(HERE.parents[1]))
|
||||
|
||||
from src import career_curves as cc
|
||||
from src import config, models, symmetric
|
||||
|
||||
MODELS_DIR = HERE / "models"
|
||||
PRIMARY = "lightgbm"
|
||||
|
||||
|
||||
def _grants_cap_table():
|
||||
"""The binned r -> capped_share mapping as plain arrays for the bundle."""
|
||||
yearly = cc.load_yearly()
|
||||
per_person = yearly.groupby("author_people").agg(
|
||||
pubs=("pubs", "sum"), grants=("grants", "sum"), capped=("grants_capped", "sum")
|
||||
)
|
||||
per_person = per_person[per_person["grants"] > 0]
|
||||
r = per_person["grants"] / per_person["pubs"].clip(lower=1)
|
||||
share = per_person["capped"] / per_person["grants"]
|
||||
bins = np.unique(np.quantile(r, np.linspace(0, 1, 21)))
|
||||
idx = np.clip(np.digitize(r, bins) - 1, 0, len(bins) - 2)
|
||||
binned = pd.DataFrame({"bin": idx, "share": share}).groupby("bin")["share"].median()
|
||||
centers = (bins[:-1] + bins[1:]) / 2
|
||||
return centers[binned.index.to_numpy()], binned.to_numpy()
|
||||
|
||||
|
||||
def _export(feats, X, y, label, model_name):
|
||||
spw = (y == 0).sum() / (y == 1).sum()
|
||||
model = models.advanced_models(scale_pos_weight=spw)[model_name]
|
||||
cv = StratifiedKFold(n_splits=5, shuffle=True, random_state=config.RANDOM_STATE)
|
||||
oof = cross_val_predict(model, X, y, cv=cv, method="predict_proba", n_jobs=-1)[:, 1]
|
||||
model.fit(X, y)
|
||||
|
||||
cap_r, cap_share = _grants_cap_table()
|
||||
bundle = {
|
||||
"model": model,
|
||||
"model_name": f"{model_name}_symmetric_{label}",
|
||||
"feature_columns": X.columns.tolist(),
|
||||
"numeric_columns": symmetric.SYMMETRIC_NUMERIC_COLUMNS,
|
||||
"log_columns": symmetric.SYMMETRIC_LOG_COLUMNS,
|
||||
"research_area_columns": [
|
||||
"publication_research_area", "patent_research_area", "grant_research_area"],
|
||||
"grants_cap_r": cap_r,
|
||||
"grants_cap_share": cap_share,
|
||||
"reference_score_quantiles": np.quantile(oof, np.linspace(0, 1, 1001)),
|
||||
}
|
||||
out = MODELS_DIR / f"{label}.joblib"
|
||||
joblib.dump(bundle, out)
|
||||
from sklearn.metrics import average_precision_score, roc_auc_score
|
||||
stats = {
|
||||
"rows": int(len(X)), "founders": int(y.sum()),
|
||||
"oof_roc_auc": round(float(roc_auc_score(y, oof)), 4),
|
||||
"oof_pr_auc": round(float(average_precision_score(y, oof)), 4),
|
||||
}
|
||||
print(f"{label}: {stats}")
|
||||
return {"file": out.name, "model": bundle["model_name"], **stats}
|
||||
|
||||
|
||||
def main():
|
||||
MODELS_DIR.mkdir(exist_ok=True)
|
||||
manifest = {"design": "symmetric landmark (see experiments/src/symmetric.py)", "bundles": []}
|
||||
|
||||
feats, attrition = symmetric.build_symmetric_dataset()
|
||||
X, y, _ = symmetric.build_matrix(feats, include_institution=False)
|
||||
manifest["attrition"] = {k: int(v) for k, v in attrition.items()}
|
||||
manifest["bundles"].append(_export(feats, X, y, "founder_classifier_v2", PRIMARY))
|
||||
|
||||
for k in [1, 3, 5]:
|
||||
feats_k, _ = symmetric.build_symmetric_dataset(offset=k)
|
||||
feats_k = feats_k[feats_k["pubs_at_index"] > 0].reset_index(drop=True)
|
||||
Xk, yk, _ = symmetric.build_matrix(feats_k, include_institution=False)
|
||||
manifest["bundles"].append(_export(feats_k, Xk, yk, f"p_within_{k}y_v2", PRIMARY))
|
||||
|
||||
(HERE / "manifest.json").write_text(json.dumps(manifest, indent=2))
|
||||
print(f"Manifest written to {HERE / 'manifest.json'}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,150 +0,0 @@
|
||||
"""Self-contained inference wrapper for the SYMMETRIC founder-potential classifier.
|
||||
|
||||
Depends only on pandas, numpy and joblib. Replaces v1 (../classifier), which
|
||||
must not be used for ranking — see README.md in this directory for what changed,
|
||||
the input contract and how to read the outputs.
|
||||
|
||||
Three contract points the caller must get right:
|
||||
- `predict` requires `scoring_year`, the year the profile snapshot was taken.
|
||||
- `percentile` is the coach-facing output; `probability_founder` is a raw
|
||||
case-control score (~26% training base rate) and is NOT a population
|
||||
founding probability.
|
||||
- Pass `grants` RAW — the wrapper applies the training per-paper cap itself.
|
||||
|
||||
Usage:
|
||||
from founder_classifier_v2 import FounderClassifierV2
|
||||
|
||||
clf = FounderClassifierV2.load("models/founder_classifier_v2.joblib")
|
||||
result = clf.predict_one({
|
||||
"publications": 40, "patents": 2, "grants": 3,
|
||||
"first_publication_year": 2005,
|
||||
"first_patent_year": 2015, "first_grant_year": 2010,
|
||||
"industry_collab_papers": 4, "linked_patents_to_publications": 1,
|
||||
"publication_research_area": "32 Biomedical and Clinical Sciences",
|
||||
"patent_research_area": "32", "grant_research_area": "32",
|
||||
}, scoring_year=2026)
|
||||
# {'percentile': 71.4, 'probability_founder': 0.38, ...}
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
import joblib
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
|
||||
|
||||
class FounderClassifierV2:
|
||||
def __init__(self, bundle: dict[str, Any]):
|
||||
self._model = bundle["model"]
|
||||
self.model_name: str = bundle["model_name"]
|
||||
self.feature_columns: list[str] = bundle["feature_columns"]
|
||||
self.numeric_columns: list[str] = bundle["numeric_columns"]
|
||||
self.log_columns: list[str] = bundle["log_columns"]
|
||||
self.research_area_columns: list[str] = bundle["research_area_columns"]
|
||||
# Grants de-inflation: interpolation table r -> capped_share, r = grants/pubs.
|
||||
self.grants_cap_r: np.ndarray = np.asarray(bundle["grants_cap_r"])
|
||||
self.grants_cap_share: np.ndarray = np.asarray(bundle["grants_cap_share"])
|
||||
# Reference score quantiles for percentile ranking (1001 points on [0,1]).
|
||||
self.reference_scores: np.ndarray = np.asarray(bundle["reference_score_quantiles"])
|
||||
|
||||
@classmethod
|
||||
def load(cls, path: str | Path) -> "FounderClassifierV2":
|
||||
return cls(joblib.load(path))
|
||||
|
||||
# -- preprocessing -------------------------------------------------------
|
||||
@staticmethod
|
||||
def _broad_research_area(value: Any) -> str:
|
||||
if value is None or (isinstance(value, float) and np.isnan(value)):
|
||||
return "n."
|
||||
return str(value).strip()[:2]
|
||||
|
||||
def _capped_grants(self, grants: np.ndarray, pubs: np.ndarray) -> np.ndarray:
|
||||
r = grants / np.clip(pubs, 1, None)
|
||||
share = np.interp(r, self.grants_cap_r, self.grants_cap_share)
|
||||
return grants * np.clip(share, 0.0, 1.0)
|
||||
|
||||
def _to_frame(self, records: list[dict[str, Any]], scoring_year: int) -> pd.DataFrame:
|
||||
df = pd.DataFrame.from_records(records, index=range(len(records)))
|
||||
for col in ["publications", "patents", "grants", "first_publication_year",
|
||||
"first_patent_year", "first_grant_year",
|
||||
"industry_collab_papers", "linked_patents_to_publications"]:
|
||||
if col not in df.columns:
|
||||
df[col] = np.nan
|
||||
df[col] = pd.to_numeric(df[col], errors="coerce")
|
||||
|
||||
pubs = df["publications"].fillna(0).to_numpy(dtype=float)
|
||||
pats = df["patents"].fillna(0).to_numpy(dtype=float)
|
||||
grants = self._capped_grants(df["grants"].fillna(0).to_numpy(dtype=float), pubs)
|
||||
first_pub = df["first_publication_year"].to_numpy(dtype=float)
|
||||
career_age = np.clip(scoring_year - first_pub, 1, None)
|
||||
has_pat = (df["first_patent_year"].notna() & (df["first_patent_year"] <= scoring_year)
|
||||
& (pats > 0)).to_numpy()
|
||||
has_grant = (df["first_grant_year"].notna() & (df["first_grant_year"] <= scoring_year)
|
||||
& (grants > 0)).to_numpy()
|
||||
|
||||
numeric = pd.DataFrame({
|
||||
"pubs_at_index": pubs,
|
||||
"patents_at_index": pats,
|
||||
"grants_at_index": grants,
|
||||
"activities_at_index": pubs + pats + grants,
|
||||
"industry_collab_at_index": df["industry_collab_papers"].fillna(0),
|
||||
"linked_pat_pub_at_index": df["linked_patents_to_publications"].fillna(0),
|
||||
"career_age_at_index": career_age,
|
||||
"first_publication_year": first_pub,
|
||||
"pub_rate": pubs / career_age,
|
||||
"patent_rate": pats / career_age,
|
||||
"grant_rate": grants / career_age,
|
||||
"has_patents_at_index": has_pat.astype(int),
|
||||
"has_grants_at_index": has_grant.astype(int),
|
||||
"years_since_first_patent": np.where(
|
||||
has_pat, np.clip(scoring_year - df["first_patent_year"].fillna(scoring_year), 0, None), 0),
|
||||
"years_since_first_grant": np.where(
|
||||
has_grant, np.clip(scoring_year - df["first_grant_year"].fillna(scoring_year), 0, None), 0),
|
||||
})
|
||||
numeric = numeric[self.numeric_columns].fillna(0)
|
||||
for col in self.log_columns:
|
||||
numeric[col] = np.log1p(numeric[col].clip(lower=0))
|
||||
|
||||
cat_df = pd.DataFrame({
|
||||
col: df.get(col, pd.Series([None] * len(df))).apply(self._broad_research_area)
|
||||
for col in self.research_area_columns
|
||||
})
|
||||
categorical = pd.get_dummies(cat_df, prefix=cat_df.columns.tolist())
|
||||
X = pd.concat([numeric, categorical], axis=1)
|
||||
return X.reindex(columns=self.feature_columns, fill_value=0)
|
||||
|
||||
# -- public API ----------------------------------------------------------
|
||||
# The model's population is academics with a minimal record (see
|
||||
# experiments/src/symmetric.py::MIN_PUBS_AT_INDEX): below this, the training
|
||||
# classes come from clashing sampling frames (company databases vs
|
||||
# institutional researcher lists) and scores are not evidence.
|
||||
MIN_PUBLICATIONS = 4
|
||||
|
||||
def predict(self, records: list[dict[str, Any]], scoring_year: int) -> pd.DataFrame:
|
||||
"""`records`: raw profile dicts (lifetime totals as of `scoring_year`).
|
||||
Returns probability_founder (raw case-control score), percentile (rank
|
||||
vs the reference cohort, 0-100; the coach-facing number), and
|
||||
in_population. When in_population is False (fewer than
|
||||
MIN_PUBLICATIONS publications) percentile is NaN: the person is outside
|
||||
the modelled population and must not be ranked."""
|
||||
X = self._to_frame(records, scoring_year)
|
||||
proba = self._model.predict_proba(X)[:, 1]
|
||||
pct = np.interp(proba, self.reference_scores, np.linspace(0, 100, len(self.reference_scores)))
|
||||
pubs = pd.DataFrame.from_records(records).get("publications", pd.Series([0] * len(records)))
|
||||
in_pop = pd.to_numeric(pubs, errors="coerce").fillna(0).to_numpy() >= self.MIN_PUBLICATIONS
|
||||
return pd.DataFrame({
|
||||
"probability_founder": proba,
|
||||
"percentile": np.where(in_pop, np.round(pct, 1), np.nan),
|
||||
"in_population": in_pop,
|
||||
})
|
||||
|
||||
def predict_one(self, record: dict[str, Any], scoring_year: int) -> dict[str, Any]:
|
||||
row = self.predict([record], scoring_year).iloc[0]
|
||||
return {
|
||||
"percentile": None if not row["in_population"] else float(row["percentile"]),
|
||||
"probability_founder": float(row["probability_founder"]),
|
||||
"in_population": bool(row["in_population"]),
|
||||
"model": self.model_name,
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
{
|
||||
"design": "symmetric landmark (see experiments/src/symmetric.py)",
|
||||
"bundles": [
|
||||
{
|
||||
"file": "founder_classifier_v2.joblib",
|
||||
"model": "lightgbm_symmetric_founder_classifier_v2",
|
||||
"rows": 9017,
|
||||
"founders": 2349,
|
||||
"oof_roc_auc": 0.8659,
|
||||
"oof_pr_auc": 0.7257
|
||||
},
|
||||
{
|
||||
"file": "p_within_1y_v2.joblib",
|
||||
"model": "lightgbm_symmetric_p_within_1y_v2",
|
||||
"rows": 8515,
|
||||
"founders": 2238,
|
||||
"oof_roc_auc": 0.8614,
|
||||
"oof_pr_auc": 0.7154
|
||||
},
|
||||
{
|
||||
"file": "p_within_3y_v2.joblib",
|
||||
"model": "lightgbm_symmetric_p_within_3y_v2",
|
||||
"rows": 7706,
|
||||
"founders": 2010,
|
||||
"oof_roc_auc": 0.861,
|
||||
"oof_pr_auc": 0.7176
|
||||
},
|
||||
{
|
||||
"file": "p_within_5y_v2.joblib",
|
||||
"model": "lightgbm_symmetric_p_within_5y_v2",
|
||||
"rows": 6995,
|
||||
"founders": 1833,
|
||||
"oof_roc_auc": 0.8535,
|
||||
"oof_pr_auc": 0.7038
|
||||
}
|
||||
],
|
||||
"attrition": {
|
||||
"initial": 16822,
|
||||
"no_publication_anchor": 1430,
|
||||
"implausible_profile_founders": 425,
|
||||
"implausible_profile_nonfounders": 770,
|
||||
"founder_bad_founding_year": 340,
|
||||
"founder_bad_career_age": 723,
|
||||
"duplicates": 0,
|
||||
"below_min_pubs_at_index_founders": 1112,
|
||||
"below_min_pubs_at_index_nonfounders": 3005
|
||||
}
|
||||
}
|
||||
@@ -1,188 +0,0 @@
|
||||
# Founder-Timing Sequence Model — Production Guide
|
||||
|
||||
Given a researcher's **year-by-year publication/patent/grant activity**,
|
||||
predicts how many years into their career a "founding-like" moment falls, and
|
||||
derives a probability of founding within the next 1/2/3/5 years. This is the
|
||||
RQ-sequence model from the research pipeline (LSTM + Transformer), re-packaged
|
||||
for a production app.
|
||||
|
||||
## 1. Which two models, and why
|
||||
|
||||
The two model architectures evaluated (`experiments/results/sequence_founders/sequence_founders_comparison.csv`),
|
||||
ranked by held-out MAE, both far ahead of the naive heuristic (MAE=0.554) and
|
||||
an aggregate-feature Random Forest (MAE=2.571) baseline:
|
||||
|
||||
| rank | model | MAE | RMSE | R2 |
|
||||
|---|---|---|---|---|
|
||||
| 1 | **transformer** | 0.180 | 0.269 | 0.998 |
|
||||
| 2 | **lstm** | 0.208 | 0.258 | 0.998 |
|
||||
|
||||
Both are shipped (`models/transformer.pt`, `models/lstm.pt`) — they are close
|
||||
enough (Δmae=0.028 years, i.e. ~10 days) that using both as a cross-check is
|
||||
worthwhile. `transformer` is marginally better on MAE, `lstm` marginally better
|
||||
on RMSE (fewer large errors); either is a reasonable default.
|
||||
|
||||
**Important scope note:** these predict `founding_age` only for the regime the
|
||||
models were trained and validated on: founders whose company started **within
|
||||
20 years of their first publication**. Founders/candidates outside that range
|
||||
were excluded from training (see `experiments/README.md` "Sequence modeling"
|
||||
section) — treat predictions for very long, established careers (> 20 years
|
||||
of activity with no founding yet) with more caution; the model has not seen
|
||||
that regime.
|
||||
|
||||
## 2. Files
|
||||
|
||||
```
|
||||
production/sequence/
|
||||
founder_timing_model.py <- self-contained wrapper (torch/numpy only)
|
||||
models/
|
||||
transformer.pt <- recommended default
|
||||
lstm.pt <- alternative / second opinion
|
||||
export_sequence_models.py <- reproducible export/training script
|
||||
```
|
||||
|
||||
Each `.pt` is a single bundle: `{model_key, net_kwargs, state_dict, scaler_mean,
|
||||
scaler_std, window, channels, held_out_metrics, held_out_residuals,
|
||||
channel_ablation_mae_delta}`. You only need `founder_timing_model.py` + one
|
||||
`.pt` file to run predictions.
|
||||
|
||||
## 3. Input schema
|
||||
|
||||
The model consumes a **20-year rolling window** (`WINDOW = 20`) of yearly
|
||||
activity counts, ending at a reference year of your choice (typically "now").
|
||||
You provide plain `{year: count}` dictionaries — the wrapper handles
|
||||
alignment, left-zero-padding (for researchers with < 20 years of history) and
|
||||
the log1p transform used at training time:
|
||||
|
||||
```python
|
||||
model.build_sequence(
|
||||
pub_counts_by_year={2015: 2, 2016: 3, 2018: 1, 2020: 4, 2022: 2},
|
||||
pat_counts_by_year={2021: 1},
|
||||
grant_counts_by_year={2019: 1},
|
||||
as_of_year=2023,
|
||||
)
|
||||
```
|
||||
|
||||
| argument | type | description | source |
|
||||
|---|---|---|---|
|
||||
| `pub_counts_by_year` | dict[int, int] | publications per calendar year | OpenAlex works' `publication_year`, grouped/counted per author |
|
||||
| `pat_counts_by_year` | dict[int, int] | patents per calendar year | your patent-matching pipeline |
|
||||
| `grant_counts_by_year` | dict[int, int] | grants/awards per calendar year | your grant-matching pipeline |
|
||||
| `as_of_year` | int | the "reference now" the 20-year window ends at (defaults to the latest year with any activity) | e.g. current year |
|
||||
| `first_publication_year` | int | year of the researcher's first publication (needed only for `years_to_founding` / probability output, not for the raw point estimate) | OpenAlex, min `publication_year` |
|
||||
|
||||
Years outside `[as_of_year - 19, as_of_year]` are ignored; years inside that
|
||||
range with no entry default to a count of 0.
|
||||
|
||||
## 4. Output format
|
||||
|
||||
```python
|
||||
model.predict(
|
||||
pub_counts_by_year=..., pat_counts_by_year=..., grant_counts_by_year=...,
|
||||
first_publication_year=2015, as_of_year=2023,
|
||||
)
|
||||
# {
|
||||
# 'model': 'transformer',
|
||||
# 'predicted_founding_age': 8.4,
|
||||
# 'current_career_age': 8,
|
||||
# 'years_to_founding': 0.4,
|
||||
# 'probability_founds_within': {1: 0.62, 2: 0.87, 3: 0.95, 5: 0.99}
|
||||
# }
|
||||
```
|
||||
|
||||
- `predicted_founding_age`: point estimate — "how many years into a career
|
||||
does this activity pattern, taken as of `as_of_year`, look like a founding
|
||||
moment."
|
||||
- `current_career_age` = `as_of_year - first_publication_year` (only returned
|
||||
if `first_publication_year` is given).
|
||||
- `years_to_founding` = `predicted_founding_age - current_career_age`. Positive
|
||||
means the model expects founding is still that many years away (given the
|
||||
current trajectory); **zero or negative means the current profile already
|
||||
looks like a typical founding-moment profile** — founding could plausibly
|
||||
happen any time now (the model can't distinguish "already overdue" from
|
||||
"right now" — see §6 caveats).
|
||||
- `probability_founds_within`: `{k: P(founds within k years)}` for k in
|
||||
(1, 2, 3, 5) by default (pass `horizons=(...)` to customize) — see §5.
|
||||
|
||||
If you omit `first_publication_year`, you get only `predicted_founding_age`
|
||||
(no probability/timing-to-now fields, since those require knowing the current
|
||||
career age).
|
||||
|
||||
## 5. Probability design (why a residual-based approach, not a retrained model)
|
||||
|
||||
The underlying LSTM/Transformer are **point-estimate regressors** (trained
|
||||
with MSE loss) — they were not retrained with a probabilistic loss for this
|
||||
deliverable, since the existing point predictions are already extremely
|
||||
accurate (R²=0.998, MAE ≈ 2-2.5 months) and retraining risks losing that
|
||||
accuracy for a marginal gain in "native" probability calibration.
|
||||
|
||||
Instead, probability is derived **post-hoc** from the held-out test set's
|
||||
residual distribution (`held_out_residuals` in the bundle, ~460 examples per
|
||||
model): `P(founds within k years) = P(residual <= k - years_to_founding)`,
|
||||
i.e. the empirical fraction of held-out errors small enough that the true
|
||||
founding time would fall within `k` years given the current point estimate.
|
||||
This is non-parametric (no Gaussian assumption) and directly reflects the
|
||||
model's actual observed error spread, at the cost of being a global (not
|
||||
per-input) uncertainty estimate — every prediction uses the same residual
|
||||
pool, it doesn't widen for "harder" inputs specifically.
|
||||
|
||||
## 6. Features that affect the prediction most
|
||||
|
||||
Channel ablation (zero out one channel, re-predict on the held-out test set,
|
||||
measure the MAE increase) — `channel_ablation_mae_delta` in each bundle:
|
||||
|
||||
| channel | lstm MAE increase | transformer MAE increase |
|
||||
|---|---|---|
|
||||
| **pub** (publications) | **+8.29** | **+8.92** |
|
||||
| pat (patents) | -0.003 (noise) | -0.020 (noise) |
|
||||
| grant (grants) | -0.004 (noise) | -0.020 (noise) |
|
||||
|
||||
**The publication timeline completely dominates.** Removing it destroys the
|
||||
model (MAE jumps from ~0.2 to ~8.5 years — essentially random). Removing
|
||||
patents or grants changes nothing (the tiny negative deltas are noise, not a
|
||||
real effect) — for *this specific task* (predicting how far into a career a
|
||||
founding-like moment falls), patent/grant timing carries no additional signal
|
||||
beyond what publication timing already provides. Practically: if your
|
||||
production pipeline is missing patent/grant year-by-year data for some
|
||||
researchers, this model will still work essentially as well using publication
|
||||
history alone — you do not need to block on having complete patent/grant
|
||||
histories for this specific model (unlike the classifier, where patent/grant
|
||||
*counts* do matter — see `../classifier/README.md` §8).
|
||||
|
||||
## 7. Usage example
|
||||
|
||||
```python
|
||||
from founder_timing_model import FounderTimingModel
|
||||
|
||||
model = FounderTimingModel.load("models/transformer.pt")
|
||||
|
||||
result = model.predict(
|
||||
pub_counts_by_year={2016: 1, 2017: 2, 2018: 3, 2019: 2, 2020: 4, 2021: 3, 2022: 5},
|
||||
pat_counts_by_year={2021: 1},
|
||||
grant_counts_by_year={2020: 1},
|
||||
first_publication_year=2016,
|
||||
as_of_year=2022,
|
||||
)
|
||||
print(result)
|
||||
```
|
||||
|
||||
## 8. Caveats
|
||||
|
||||
- **Founders-only training data.** These models were trained exclusively on
|
||||
people who eventually founded a company, predicting *when in their career*
|
||||
that happened. There is no matched non-founder sequence in the source data
|
||||
(see `experiments/README.md` "Sequence modeling" for why), so this model
|
||||
cannot tell you whether someone will found at all — only, conditional on a
|
||||
founding-like pattern existing, how far into the career it falls. Combine
|
||||
with the classifier (`../classifier/README.md`) for the "will they found at
|
||||
all" question, and this model for "when."
|
||||
- **Retrospective training, prospective use.** Training examples anchor the
|
||||
20-year window at a *real, already-known* founding event. Using the window
|
||||
ending at "now" for someone who hasn't founded yet is a reasonable,
|
||||
intended extrapolation but was not directly validated against real
|
||||
future-unknown outcomes (no ground truth exists yet for currently-active
|
||||
non-founders). Treat `years_to_founding` as a useful signal/ranking tool
|
||||
more than a precise calendar forecast.
|
||||
- **Fixed 20-year window, [1, 20] founding-age range.** See §1.
|
||||
- Reproduce or retrain via `export_sequence_models.py` (depends on the full
|
||||
`experiments/src` research package + `evaluation/datasets_complete`).
|
||||
@@ -1,100 +0,0 @@
|
||||
"""Export the two best founder-timing sequence models (LSTM + Transformer) as
|
||||
standalone production artifacts, with a post-hoc probability layer derived from
|
||||
held-out residuals (see README.md "Probability design" section for rationale).
|
||||
|
||||
Run: conda run -n potential python production/sequence/export_sequence_models.py
|
||||
(from the experiments/ directory)
|
||||
"""
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
from sklearn.model_selection import train_test_split
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[2]))
|
||||
from src import config, evaluate, sequence_data, sequence_models # noqa: E402
|
||||
|
||||
OUT_DIR = Path(__file__).resolve().parent
|
||||
MODELS_DIR = OUT_DIR / "models"
|
||||
MODELS_DIR.mkdir(exist_ok=True)
|
||||
|
||||
LSTM_KWARGS = {"hidden_size": 64, "num_layers": 1, "dropout": 0.2}
|
||||
TRANSFORMER_KWARGS = {"d_model": 32, "n_heads": 4, "n_layers": 2, "dropout": 0.2}
|
||||
|
||||
|
||||
def channel_ablation(model, X_test, y_test, base_mae):
|
||||
"""Zero out one channel at a time (post-hoc, on the already-fitted model)
|
||||
and measure the MAE increase -- a cheap proxy for channel importance."""
|
||||
rows = {}
|
||||
for c, name in enumerate(sequence_data.CHANNELS):
|
||||
X_ablated = X_test.copy()
|
||||
X_ablated[:, :, c] = 0.0
|
||||
pred = model.predict(X_ablated)
|
||||
metrics = evaluate.regression_metrics(y_test, pred)
|
||||
rows[name] = metrics["mae"] - base_mae
|
||||
return rows
|
||||
|
||||
|
||||
def build_and_export(model_key, model_cls, net_kwargs, X_train, y_train, X_test, y_test, X_all, y_all):
|
||||
print(f"\n=== {model_key} ===")
|
||||
# 1) Fit on train only -> honest held-out metrics + residuals + channel ablation.
|
||||
model = model_cls(**net_kwargs)
|
||||
model.fit(X_train, y_train)
|
||||
pred_test = model.predict(X_test)
|
||||
metrics = evaluate.regression_metrics(y_test, pred_test)
|
||||
residuals = (y_test - pred_test).astype(np.float32)
|
||||
print(f" held-out: MAE={metrics['mae']:.3f} RMSE={metrics['rmse']:.3f} R2={metrics['r2']:.3f}")
|
||||
|
||||
ablation = channel_ablation(model, X_test, y_test, metrics["mae"])
|
||||
print(" channel ablation (MAE increase when channel is zeroed out):")
|
||||
for ch, delta in sorted(ablation.items(), key=lambda kv: -kv[1]):
|
||||
print(f" {ch:6s} +{delta:.4f} MAE")
|
||||
|
||||
# 2) Refit on ALL data for the final shipped artifact (standard practice;
|
||||
# generalization already validated above).
|
||||
final_model = model_cls(**net_kwargs)
|
||||
final_model.fit(X_all, y_all)
|
||||
|
||||
bundle = {
|
||||
"model_key": model_key,
|
||||
"net_kwargs": net_kwargs,
|
||||
"state_dict": final_model.model_.state_dict(),
|
||||
"scaler_mean": final_model.scaler_.mean_,
|
||||
"scaler_std": final_model.scaler_.std_,
|
||||
"window": sequence_data.WINDOW,
|
||||
"channels": sequence_data.CHANNELS,
|
||||
"held_out_metrics": metrics,
|
||||
"held_out_residuals": residuals,
|
||||
"channel_ablation_mae_delta": ablation,
|
||||
}
|
||||
out_path = MODELS_DIR / f"{model_key}.pt"
|
||||
torch.save(bundle, out_path)
|
||||
print(f" saved {out_path} ({out_path.stat().st_size / 1024:.0f} KB)")
|
||||
return metrics, residuals, ablation
|
||||
|
||||
|
||||
def main():
|
||||
print("Building founder-only sequence dataset...")
|
||||
sequences, founding_age, meta = sequence_data.build_founder_sequence_dataset()
|
||||
|
||||
idx = np.arange(len(sequences))
|
||||
idx_train, idx_test = train_test_split(idx, test_size=0.2, random_state=config.RANDOM_STATE)
|
||||
X_train, X_test = sequences[idx_train], sequences[idx_test]
|
||||
y_train, y_test = founding_age[idx_train], founding_age[idx_test]
|
||||
|
||||
results = {}
|
||||
results["lstm"] = build_and_export(
|
||||
"lstm", sequence_models.LSTMRegressor, LSTM_KWARGS,
|
||||
X_train, y_train, X_test, y_test, sequences, founding_age,
|
||||
)
|
||||
results["transformer"] = build_and_export(
|
||||
"transformer", sequence_models.TransformerRegressor, TRANSFORMER_KWARGS,
|
||||
X_train, y_train, X_test, y_test, sequences, founding_age,
|
||||
)
|
||||
|
||||
print("\nDone. Shipped: lstm.pt, transformer.pt")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,192 +0,0 @@
|
||||
"""Self-contained inference wrapper for the founder-timing sequence models
|
||||
(LSTM / Transformer). Depends only on torch/numpy -- no dependency on the
|
||||
`experiments/src` research package.
|
||||
|
||||
These models predict `founding_age`: how many years into a researcher's
|
||||
publishing career a founding event falls, given their chronological
|
||||
publication/patent/grant activity in the WINDOW (20) years up to and including
|
||||
the reference point of interest ("now", if you're asking "how founding-ready
|
||||
does this person look today").
|
||||
|
||||
Usage:
|
||||
from founder_timing_model import FounderTimingModel
|
||||
|
||||
model = FounderTimingModel.load("models/transformer.pt")
|
||||
result = model.predict(
|
||||
pub_counts_by_year={2015: 2, 2016: 3, 2017: 1, 2020: 4, 2022: 2},
|
||||
pat_counts_by_year={2021: 1},
|
||||
grant_counts_by_year={2019: 1},
|
||||
first_publication_year=2015,
|
||||
as_of_year=2023,
|
||||
)
|
||||
print(result)
|
||||
|
||||
See README.md in this directory for the full input schema, output format and
|
||||
the "probability" design rationale.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
from torch import nn
|
||||
|
||||
CHANNELS = ["pub", "pat", "grant"]
|
||||
WINDOW = 20
|
||||
DEFAULT_HORIZONS = (1, 2, 3, 5)
|
||||
|
||||
|
||||
class _LSTMNet(nn.Module):
|
||||
"""Must stay structurally identical to src/sequence_models.py::_LSTMNet --
|
||||
state_dict keys are loaded directly from the exported bundle."""
|
||||
|
||||
def __init__(self, n_channels, hidden_size=64, num_layers=1, dropout=0.2):
|
||||
super().__init__()
|
||||
self.lstm = nn.LSTM(
|
||||
input_size=n_channels, hidden_size=hidden_size, num_layers=num_layers,
|
||||
batch_first=True, dropout=dropout if num_layers > 1 else 0.0,
|
||||
)
|
||||
self.head = nn.Sequential(nn.Dropout(dropout), nn.Linear(hidden_size, 1))
|
||||
|
||||
def forward(self, x):
|
||||
_, (h_n, _) = self.lstm(x)
|
||||
return self.head(h_n[-1]).squeeze(-1)
|
||||
|
||||
|
||||
class _TransformerNet(nn.Module):
|
||||
"""Must stay structurally identical to src/sequence_models.py::_TransformerNet."""
|
||||
|
||||
def __init__(self, n_channels, seq_len, d_model=32, n_heads=4, n_layers=2, dropout=0.2):
|
||||
super().__init__()
|
||||
self.input_proj = nn.Linear(n_channels, d_model)
|
||||
self.pos_embedding = nn.Parameter(torch.zeros(1, seq_len, d_model))
|
||||
encoder_layer = nn.TransformerEncoderLayer(
|
||||
d_model=d_model, nhead=n_heads, dim_feedforward=d_model * 4,
|
||||
dropout=dropout, batch_first=True,
|
||||
)
|
||||
self.encoder = nn.TransformerEncoder(encoder_layer, num_layers=n_layers)
|
||||
self.head = nn.Sequential(nn.Dropout(dropout), nn.Linear(d_model, 1))
|
||||
|
||||
def forward(self, x):
|
||||
h = self.input_proj(x) + self.pos_embedding
|
||||
h = self.encoder(h)
|
||||
pooled = h.mean(dim=1)
|
||||
return self.head(pooled).squeeze(-1)
|
||||
|
||||
|
||||
class FounderTimingModel:
|
||||
def __init__(self, bundle: dict[str, Any]):
|
||||
self.model_key: str = bundle["model_key"]
|
||||
self.window: int = bundle["window"]
|
||||
self.channels: list[str] = bundle["channels"]
|
||||
self.scaler_mean = bundle["scaler_mean"]
|
||||
self.scaler_std = bundle["scaler_std"]
|
||||
self.held_out_metrics: dict = bundle["held_out_metrics"]
|
||||
self.held_out_residuals: np.ndarray = bundle["held_out_residuals"]
|
||||
self.channel_ablation_mae_delta: dict = bundle["channel_ablation_mae_delta"]
|
||||
|
||||
n_channels = len(self.channels)
|
||||
if self.model_key == "lstm":
|
||||
self._net = _LSTMNet(n_channels, **bundle["net_kwargs"])
|
||||
elif self.model_key == "transformer":
|
||||
self._net = _TransformerNet(n_channels, self.window, **bundle["net_kwargs"])
|
||||
else:
|
||||
raise ValueError(f"unknown model_key {self.model_key!r}")
|
||||
self._net.load_state_dict(bundle["state_dict"])
|
||||
self._net.eval()
|
||||
|
||||
@classmethod
|
||||
def load(cls, path: str | Path) -> "FounderTimingModel":
|
||||
return cls(torch.load(path, map_location="cpu", weights_only=False))
|
||||
|
||||
# -- building the input sequence ----------------------------------------
|
||||
def build_sequence(
|
||||
self,
|
||||
pub_counts_by_year: dict[int, int] | None = None,
|
||||
pat_counts_by_year: dict[int, int] | None = None,
|
||||
grant_counts_by_year: dict[int, int] | None = None,
|
||||
as_of_year: int | None = None,
|
||||
) -> np.ndarray:
|
||||
"""Turn per-year activity counts into the (WINDOW, 3) chronological,
|
||||
log1p-transformed array the model expects (oldest year first, ending
|
||||
at `as_of_year`). Years with no recorded activity default to 0; years
|
||||
before the start of the available history are zero-padded on the left
|
||||
(identical in spirit to how a founder with < WINDOW years of real
|
||||
pre-founding history looks in the training data)."""
|
||||
pub_counts_by_year = pub_counts_by_year or {}
|
||||
pat_counts_by_year = pat_counts_by_year or {}
|
||||
grant_counts_by_year = grant_counts_by_year or {}
|
||||
if as_of_year is None:
|
||||
all_years = list(pub_counts_by_year) + list(pat_counts_by_year) + list(grant_counts_by_year)
|
||||
if not all_years:
|
||||
raise ValueError("as_of_year must be given if no activity years are provided")
|
||||
as_of_year = max(all_years)
|
||||
|
||||
years = range(as_of_year - self.window + 1, as_of_year + 1) # oldest -> newest, length WINDOW
|
||||
channel_dicts = [pub_counts_by_year, pat_counts_by_year, grant_counts_by_year]
|
||||
seq = np.zeros((self.window, len(self.channels)), dtype=np.float32)
|
||||
for c, counts in enumerate(channel_dicts):
|
||||
for t, year in enumerate(years):
|
||||
seq[t, c] = max(0.0, float(counts.get(year, 0)))
|
||||
return np.log1p(seq)
|
||||
|
||||
# -- prediction -----------------------------------------------------------
|
||||
def _predict_point(self, sequence: np.ndarray) -> np.ndarray:
|
||||
"""`sequence`: (WINDOW, 3) or (n, WINDOW, 3) raw (log1p'd) array."""
|
||||
X = np.asarray(sequence, dtype=np.float32)
|
||||
if X.ndim == 2:
|
||||
X = X[None, ...]
|
||||
X = (X - self.scaler_mean) / self.scaler_std
|
||||
with torch.no_grad():
|
||||
pred = self._net(torch.tensor(X, dtype=torch.float32)).numpy()
|
||||
return pred
|
||||
|
||||
def residual_cdf(self, x: float) -> float:
|
||||
"""Empirical P(residual <= x) from the held-out test set -- the
|
||||
nonparametric basis for every probability this class reports."""
|
||||
return float(np.mean(self.held_out_residuals <= x))
|
||||
|
||||
def predict(
|
||||
self,
|
||||
pub_counts_by_year: dict[int, int] | None = None,
|
||||
pat_counts_by_year: dict[int, int] | None = None,
|
||||
grant_counts_by_year: dict[int, int] | None = None,
|
||||
first_publication_year: int | None = None,
|
||||
as_of_year: int | None = None,
|
||||
horizons: tuple[int, ...] = DEFAULT_HORIZONS,
|
||||
) -> dict[str, Any]:
|
||||
"""Full prediction for one researcher's history ending at `as_of_year`
|
||||
(defaults to the latest year with any recorded activity).
|
||||
|
||||
Returns:
|
||||
predicted_founding_age: point estimate of "years into career at the
|
||||
hypothetical founding moment defined by `as_of_year`".
|
||||
current_career_age: as_of_year - first_publication_year (if given).
|
||||
years_to_founding: predicted_founding_age - current_career_age; <=0
|
||||
means the current activity profile already looks like a typical
|
||||
founding-moment profile (founding could happen any time now).
|
||||
probability_founds_within: {k: P(founds within k years)} for each
|
||||
horizon in `horizons`, derived from held-out residuals (see README).
|
||||
"""
|
||||
seq = self.build_sequence(pub_counts_by_year, pat_counts_by_year, grant_counts_by_year, as_of_year)
|
||||
founding_age_hat = float(self._predict_point(seq)[0])
|
||||
|
||||
result: dict[str, Any] = {
|
||||
"model": self.model_key,
|
||||
"predicted_founding_age": founding_age_hat,
|
||||
}
|
||||
|
||||
if first_publication_year is not None:
|
||||
if as_of_year is None:
|
||||
all_years = list((pub_counts_by_year or {})) + list((pat_counts_by_year or {})) + list((grant_counts_by_year or {}))
|
||||
as_of_year = max(all_years) if all_years else first_publication_year
|
||||
current_career_age = as_of_year - first_publication_year
|
||||
years_to_founding = founding_age_hat - current_career_age
|
||||
result["current_career_age"] = current_career_age
|
||||
result["years_to_founding"] = years_to_founding
|
||||
result["probability_founds_within"] = {
|
||||
k: round(self.residual_cdf(k - years_to_founding), 4) for k in horizons
|
||||
}
|
||||
return result
|
||||
@@ -1,3 +0,0 @@
|
||||
,0
|
||||
statistic,83.84013605442176
|
||||
p_value,5.3644585148746496e-20
|
||||
|
@@ -1,100 +0,0 @@
|
||||
feature,importance_mean,importance_std
|
||||
publications,0.4440974603875724,0.009511785737132612
|
||||
pub_citation_sum,0.0641745019900897,0.0023847457046495867
|
||||
last_patent_year,0.061419305752316286,0.0032168477466114997
|
||||
i10-index,0.052808315628195955,0.002509050818671705
|
||||
pub_citation_mean,0.042499292031831906,0.002523272278649042
|
||||
g-index,0.036249565551782555,0.002265360125324732
|
||||
activities_total,0.03186015042559469,0.001859142044274061
|
||||
pat_citation_mean,0.023747584504377334,0.0018054623744417433
|
||||
grants,0.014545800960367655,0.001636080338818295
|
||||
first_publication_year,0.01341695838784518,0.0011208069436919059
|
||||
last_publication_year,0.010105477585606454,0.001265829119215705
|
||||
patents,0.009386919235293584,0.000828161224172823
|
||||
last_grant_year,0.0061119416876279035,0.0006396038493956664
|
||||
publication_research_area_32,0.005199808047404142,0.0006411887411683997
|
||||
h-index,0.004761111131916573,0.0006185755476381059
|
||||
pat_citation_sum,0.004029264901793272,0.0006407043313268342
|
||||
affiliations,0.003924122102600141,0.0006734435898464144
|
||||
industry_collab_papers,0.002771785899856466,0.000458393950826596
|
||||
first_grant_year,0.0024780107524362215,0.00045174085545348724
|
||||
linked_patents_to_publications,0.0017714854471442888,0.00038735536489506483
|
||||
grant_research_impact,0.0017419551968919865,0.0007783860555244073
|
||||
publication_research_area_31,0.0010347728515872068,0.0004380600676750018
|
||||
publication_research_area_46,0.0010296404274699467,0.00027494253110439427
|
||||
institution_stanford,0.0009637600715686423,0.00023666778366864807
|
||||
patent_research_area_46,0.0007991644733361059,0.0003005059902911959
|
||||
grant_research_area_32,0.0006102226280733592,0.0003698845134606399
|
||||
institution_berkeley,0.00045373766528075123,0.00021951745011740962
|
||||
institution_muenchen,0.0004130569816417906,7.580252297057787e-05
|
||||
patent_research_area_32,0.00036940421614752863,0.00011610246817244868
|
||||
publication_research_area_35,0.0003162362804154439,0.00017402147914398575
|
||||
publication_research_area_42,0.00029062839366878477,0.00015928133313129265
|
||||
institution_oxford,0.0002602274221759626,0.000185358155946732
|
||||
first_patent_year,0.0002299601664907669,0.00015372021880899557
|
||||
institution_telaviv,0.00022185659229883025,0.0002808557319380741
|
||||
institution_harvard,0.00022091161950384407,0.00018883040518073856
|
||||
patent_research_area_35,0.00017105334272454753,0.00013583506288295137
|
||||
publication_research_area_51,0.0001581465869737786,0.00013922623521323216
|
||||
grant_innovation_impact,0.00013702479636796828,0.0001422675814029339
|
||||
institution_ude,0.00013034268850643517,5.51579297443134e-05
|
||||
publication_research_area_33,0.00011963406695062462,9.734481095501337e-05
|
||||
publication_research_area_40,6.163246509007791e-05,8.342838939511106e-05
|
||||
grant_research_area_46,5.6425844484753186e-05,6.057990043771272e-05
|
||||
grant_research_area_42,5.4768959582357504e-05,0.0001321879842622329
|
||||
publication_research_area_44,4.6328393106159774e-05,4.109464765116167e-05
|
||||
institution_toronto,4.203267111526077e-05,0.00013829259973950555
|
||||
grant_research_area_34,3.648946572037404e-05,9.856576928560712e-05
|
||||
publication_research_area_49,3.523595518664657e-05,1.0020003875083567e-05
|
||||
publication_research_area_52,2.8243411024614362e-05,6.365046136625705e-05
|
||||
grant_research_area_52,2.4976831800399558e-05,6.0461267957791294e-05
|
||||
publication_research_area_39,2.2444089520501364e-05,5.4003334909501585e-05
|
||||
publication_research_area_47,2.080080050642641e-05,2.1829610866522595e-05
|
||||
patent_research_area_34,1.2265010515000175e-05,3.4309040012788196e-06
|
||||
publication_research_area_34,1.0963870610469772e-05,5.079619737042506e-05
|
||||
publication_research_area_37,9.739396381164278e-06,1.5473891954426686e-05
|
||||
grant_research_area_31,9.05566937272062e-06,1.2355287634925927e-05
|
||||
grant_research_area_33,7.176496559663237e-06,1.1600418122926559e-05
|
||||
publication_research_area_36,6.871129506863527e-06,1.8889049455628318e-05
|
||||
publication_research_area_50,6.313148147923942e-06,8.093717579945578e-06
|
||||
patent_research_area_41,5.268894264148782e-06,1.4185767546691009e-05
|
||||
grant_research_area_36,3.979969424106055e-06,8.741862922562177e-06
|
||||
grant_research_area_51,2.6849918500770897e-06,7.727353969929902e-05
|
||||
grant_research_area_39,2.6844415874804907e-06,4.9698681231697676e-06
|
||||
patent_research_area_42,2.018322524721672e-06,4.003947557053808e-06
|
||||
patent_research_area_n.,1.5509887295039881e-06,2.7724586593788047e-05
|
||||
grant_research_area_35,2.794525058302799e-07,2.2550590120034133e-06
|
||||
patent_research_area_30,1.1961448171393662e-07,6.938865295073371e-07
|
||||
grant_research_area_47,0.0,0.0
|
||||
publication_research_area_43,0.0,0.0
|
||||
grant_research_area_43,0.0,0.0
|
||||
patent_research_area_33,0.0,0.0
|
||||
grant_research_area_38,0.0,0.0
|
||||
grant_research_area_37,0.0,0.0
|
||||
patent_research_area_37,0.0,0.0
|
||||
patent_research_area_36,0.0,0.0
|
||||
grant_research_area_49,0.0,0.0
|
||||
patent_research_area_38,0.0,0.0
|
||||
grant_research_area_30,0.0,0.0
|
||||
patent_research_area_52,0.0,0.0
|
||||
patent_research_area_50,0.0,0.0
|
||||
patent_research_area_49,0.0,0.0
|
||||
patent_research_area_48,0.0,0.0
|
||||
patent_research_area_47,0.0,0.0
|
||||
patent_research_area_39,0.0,0.0
|
||||
patent_research_area_44,0.0,0.0
|
||||
patent_research_area_43,0.0,0.0
|
||||
grant_research_area_48,0.0,0.0
|
||||
publication_research_area_48,-4.777574768688453e-07,2.5399584991121672e-06
|
||||
grant_research_area_44,-2.6545860416726797e-06,8.853044030928573e-07
|
||||
grant_research_area_40,-3.5805367832819624e-06,1.3088192634427606e-05
|
||||
publication_research_area_41,-4.670934500378143e-06,1.529003843001235e-05
|
||||
patent_research_area_51,-5.39510398220866e-06,6.7771380831518544e-06
|
||||
grant_research_area_50,-6.018075757896479e-06,3.415361829511047e-06
|
||||
publication_research_area_n.,-1.6678560361260698e-05,4.85699334820089e-05
|
||||
patent_research_area_40,-2.2966722354866854e-05,2.624449457092434e-05
|
||||
publication_research_area_30,-2.759677706088981e-05,4.2392146152842375e-05
|
||||
grant_research_area_41,-7.746870943114436e-05,4.853083326762734e-05
|
||||
patent_research_area_31,-7.858662076178912e-05,2.6338982228252595e-05
|
||||
publication_research_area_38,-0.00010061127127826141,6.048638875532882e-05
|
||||
grant_research_area_n.,-0.00018513837033415915,0.00010988699811737849
|
||||
|
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 171 KiB |
|
Before Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 57 KiB |
@@ -1,25 +0,0 @@
|
||||
held_out_institution,model,accuracy,precision,recall,f1,roc_auc,pr_auc,mcc,brier
|
||||
berkeley,random_forest,0.8938080495356037,0.8561034761519806,0.8651960784313726,0.8606257618854124,0.9508687988322615,0.9352701725889087,0.7748863967212042,0.0916010325285079
|
||||
berkeley,xgboost,0.9352941176470588,0.9163248564397046,0.9125816993464052,0.9144494474007367,0.9782380798780129,0.9728371029060612,0.8624255919906876,0.05184710770845413
|
||||
berkeley,lightgbm,0.9402476780185759,0.9242798353909465,0.9174836601307189,0.9208692086920869,0.981150910015053,0.9755184511242864,0.8728875867367218,0.04690752230798288
|
||||
harvard,random_forest,0.8987654320987655,0.9052183173588925,0.7805325987144169,0.8382642998027613,0.9526397485697599,0.9290937209525628,0.7696254787865199,0.08178858160630093
|
||||
harvard,xgboost,0.9395061728395062,0.9425173439048563,0.8732782369146006,0.9065776930409915,0.9807783681880297,0.9706333807958668,0.8633170529628762,0.04677882418036461
|
||||
harvard,lightgbm,0.9398148148148148,0.9461077844311377,0.8705234159779615,0.9067431850789096,0.9826362607521476,0.9734330946079244,0.8640565194125395,0.043685045783186834
|
||||
muenchen,random_forest,0.7953757225433526,0.6064139941690962,0.832,0.7015177065767285,0.8767349593495936,0.7765094185861298,0.5675742666446973,0.15746290406976293
|
||||
muenchen,xgboost,0.7884393063583816,0.6012084592145015,0.796,0.685025817555938,0.8628682926829269,0.763287320123835,0.542216159841516,0.1559271514415741
|
||||
muenchen,lightgbm,0.7722543352601156,0.581039755351682,0.76,0.658578856152513,0.853691056910569,0.7517422512407861,0.5022355737952905,0.15695599279447855
|
||||
oxford,random_forest,0.911386593204775,0.8539898132427843,0.8245901639344262,0.8390325271059216,0.959453412512546,0.9238390784736245,0.7781516198820395,0.07865284747427456
|
||||
oxford,xgboost,0.9504132231404959,0.9183333333333333,0.9032786885245901,0.9107438016528926,0.984900886584142,0.9722281536725682,0.8764751247733411,0.042194340378046036
|
||||
oxford,lightgbm,0.9554637281910009,0.9253731343283582,0.9147540983606557,0.920032976092333,0.9877645115423219,0.976680741461625,0.8892006068129127,0.03689864957054344
|
||||
stanford,random_forest,0.9001419782300047,0.912889935256033,0.8498630136986302,0.880249716231555,0.9613942820628392,0.9572731678928575,0.7963001054601905,0.08187944047855213
|
||||
stanford,xgboost,0.9245149077141505,0.9096844396082698,0.9161643835616439,0.9129129129129129,0.9797777181881978,0.9772211505881503,0.846320011438327,0.05441083386540413
|
||||
stanford,lightgbm,0.927117841930904,0.9138025095471904,0.9178082191780822,0.9158009841443412,0.9798291807637229,0.9769930836860543,0.8515608804568686,0.053898616481872476
|
||||
telaviv,random_forest,0.9329221279876638,0.9143730886850153,0.9507154213036566,0.9321901792673422,0.9814694934455415,0.9840855248253557,0.8665222579580186,0.06278409820550628
|
||||
telaviv,xgboost,0.9498843484965305,0.9338461538461539,0.9650238473767886,0.9491790461297889,0.9915843987700276,0.9928955188919398,0.9002477352802948,0.035886093974113464
|
||||
telaviv,lightgbm,0.9568234387047032,0.9428129829984544,0.9697933227344993,0.9561128526645768,0.992805327342136,0.9938473761123844,0.9139930650897162,0.03212358373132753
|
||||
toronto,random_forest,0.8310708898944194,0.7942857142857143,0.6465116279069767,0.7128205128205128,0.8714571220930232,0.8089004180527387,0.6012626875361187,0.13535280288698756
|
||||
toronto,xgboost,0.8144796380090498,0.8006535947712419,0.5697674418604651,0.6657608695652174,0.8658689784053156,0.8011683092591997,0.5573915163186545,0.13123539090156555
|
||||
toronto,lightgbm,0.8076923076923077,0.7986348122866894,0.5441860465116279,0.6473029045643154,0.8486399501661129,0.7789467464984129,0.5396833164956024,0.14120805997827313
|
||||
ude,random_forest,0.9242424242424242,0.6923076923076923,0.9,0.782608695652174,0.9624999999999999,0.8845213408920609,0.7469892572492464,0.08766724613880275
|
||||
ude,xgboost,0.9318181818181818,0.7037037037037037,0.95,0.8085106382978723,0.978125,0.9280225174865269,0.780952380952381,0.05495387688279152
|
||||
ude,lightgbm,0.946969696969697,0.76,0.95,0.8444444444444444,0.9870535714285714,0.9470631781805057,0.8203096227459236,0.04920439998805263
|
||||
|
@@ -1,26 +0,0 @@
|
||||
| | accuracy | precision | recall | f1 | roc_auc | pr_auc | mcc | brier |
|
||||
|:------------------------------|-----------:|------------:|---------:|---------:|----------:|---------:|---------:|----------:|
|
||||
| ('berkeley', 'random_forest') | 0.893808 | 0.856103 | 0.865196 | 0.860626 | 0.950869 | 0.93527 | 0.774886 | 0.091601 |
|
||||
| ('berkeley', 'xgboost') | 0.935294 | 0.916325 | 0.912582 | 0.914449 | 0.978238 | 0.972837 | 0.862426 | 0.0518471 |
|
||||
| ('berkeley', 'lightgbm') | 0.940248 | 0.92428 | 0.917484 | 0.920869 | 0.981151 | 0.975518 | 0.872888 | 0.0469075 |
|
||||
| ('harvard', 'random_forest') | 0.898765 | 0.905218 | 0.780533 | 0.838264 | 0.95264 | 0.929094 | 0.769625 | 0.0817886 |
|
||||
| ('harvard', 'xgboost') | 0.939506 | 0.942517 | 0.873278 | 0.906578 | 0.980778 | 0.970633 | 0.863317 | 0.0467788 |
|
||||
| ('harvard', 'lightgbm') | 0.939815 | 0.946108 | 0.870523 | 0.906743 | 0.982636 | 0.973433 | 0.864057 | 0.043685 |
|
||||
| ('muenchen', 'random_forest') | 0.795376 | 0.606414 | 0.832 | 0.701518 | 0.876735 | 0.776509 | 0.567574 | 0.157463 |
|
||||
| ('muenchen', 'xgboost') | 0.788439 | 0.601208 | 0.796 | 0.685026 | 0.862868 | 0.763287 | 0.542216 | 0.155927 |
|
||||
| ('muenchen', 'lightgbm') | 0.772254 | 0.58104 | 0.76 | 0.658579 | 0.853691 | 0.751742 | 0.502236 | 0.156956 |
|
||||
| ('oxford', 'random_forest') | 0.911387 | 0.85399 | 0.82459 | 0.839033 | 0.959453 | 0.923839 | 0.778152 | 0.0786528 |
|
||||
| ('oxford', 'xgboost') | 0.950413 | 0.918333 | 0.903279 | 0.910744 | 0.984901 | 0.972228 | 0.876475 | 0.0421943 |
|
||||
| ('oxford', 'lightgbm') | 0.955464 | 0.925373 | 0.914754 | 0.920033 | 0.987765 | 0.976681 | 0.889201 | 0.0368986 |
|
||||
| ('stanford', 'random_forest') | 0.900142 | 0.91289 | 0.849863 | 0.88025 | 0.961394 | 0.957273 | 0.7963 | 0.0818794 |
|
||||
| ('stanford', 'xgboost') | 0.924515 | 0.909684 | 0.916164 | 0.912913 | 0.979778 | 0.977221 | 0.84632 | 0.0544108 |
|
||||
| ('stanford', 'lightgbm') | 0.927118 | 0.913803 | 0.917808 | 0.915801 | 0.979829 | 0.976993 | 0.851561 | 0.0538986 |
|
||||
| ('telaviv', 'random_forest') | 0.932922 | 0.914373 | 0.950715 | 0.93219 | 0.981469 | 0.984086 | 0.866522 | 0.0627841 |
|
||||
| ('telaviv', 'xgboost') | 0.949884 | 0.933846 | 0.965024 | 0.949179 | 0.991584 | 0.992896 | 0.900248 | 0.0358861 |
|
||||
| ('telaviv', 'lightgbm') | 0.956823 | 0.942813 | 0.969793 | 0.956113 | 0.992805 | 0.993847 | 0.913993 | 0.0321236 |
|
||||
| ('toronto', 'random_forest') | 0.831071 | 0.794286 | 0.646512 | 0.712821 | 0.871457 | 0.8089 | 0.601263 | 0.135353 |
|
||||
| ('toronto', 'xgboost') | 0.81448 | 0.800654 | 0.569767 | 0.665761 | 0.865869 | 0.801168 | 0.557392 | 0.131235 |
|
||||
| ('toronto', 'lightgbm') | 0.807692 | 0.798635 | 0.544186 | 0.647303 | 0.84864 | 0.778947 | 0.539683 | 0.141208 |
|
||||
| ('ude', 'random_forest') | 0.924242 | 0.692308 | 0.9 | 0.782609 | 0.9625 | 0.884521 | 0.746989 | 0.0876672 |
|
||||
| ('ude', 'xgboost') | 0.931818 | 0.703704 | 0.95 | 0.808511 | 0.978125 | 0.928023 | 0.780952 | 0.0549539 |
|
||||
| ('ude', 'lightgbm') | 0.94697 | 0.76 | 0.95 | 0.844444 | 0.987054 | 0.947063 | 0.82031 | 0.0492044 |
|
||||
@@ -1,13 +0,0 @@
|
||||
model,accuracy,precision,recall,f1,roc_auc,pr_auc,mcc,brier
|
||||
lightgbm,0.9296756592906942,0.913372582001682,0.8938271604938272,0.9034941763727121,0.976269322211954,0.9685049361518786,0.8483100198135644,0.053432731044197566
|
||||
stacking_ensemble,0.9269475598666262,0.8965798045602605,0.9061728395061729,0.9013507981989357,0.9754794515137872,0.9675765397034317,0.8433811094467112,0.05719178794634457
|
||||
xgboost,0.9269475598666262,0.907190635451505,0.8930041152263375,0.9000414765657404,0.9744139159419603,0.9665730556966816,0.8425529635211692,0.05556803196668625
|
||||
catboost,0.9224007274931798,0.9026028547439127,0.8847736625514403,0.8935993349958438,0.971654897593264,0.9632567246873249,0.8326428131667227,0.059948209000983244
|
||||
torch_mlp,0.9196726280691119,0.8984899328859061,0.8814814814814815,0.8899044453676777,0.9622309502934369,0.955302995455666,0.8267763485833509,0.06462439894676208
|
||||
random_forest,0.8957259775689603,0.8731790916880892,0.8386831275720165,0.855583543240974,0.951964210958666,0.9349680824025975,0.7744264740411075,0.08763717778689288
|
||||
logistic_regression,0.881782358290391,0.8235294117647058,0.8641975308641975,0.8433734939759037,0.9434869236905918,0.9275477315216814,0.7490861135477721,0.08788246377799803
|
||||
svm_rbf,0.8754167929675659,0.845360824742268,0.8098765432098766,0.8272383354350568,0.9373219828914007,0.9143562404019991,0.7303022058858781,0.09180799832693237
|
||||
decision_tree,0.8375265231888451,0.7379117028731604,0.8666666666666667,0.7971233913701741,0.9210842160138386,0.8829334748606221,0.6690488462111767,0.10435262951516595
|
||||
knn,0.8184298272203698,0.8162217659137577,0.654320987654321,0.7263590680676107,0.880971619945815,0.8208621350700424,0.6010655862759007,0.13055538715435655
|
||||
gaussian_nb,0.7241588360109124,0.8056112224448898,0.3308641975308642,0.4690781796966161,0.8162221669312734,0.7211454455622044,0.3827487061238318,0.2730256049045907
|
||||
dummy_most_frequent,0.6317065777508336,0.0,0.0,0.0,0.5,0.3682934222491664,0.0,0.3682934222491664
|
||||
|
@@ -1,14 +0,0 @@
|
||||
| model | accuracy | precision | recall | f1 | roc_auc | pr_auc | mcc | brier |
|
||||
|:--------------------|-----------:|------------:|---------:|---------:|----------:|---------:|---------:|----------:|
|
||||
| lightgbm | 0.929676 | 0.913373 | 0.893827 | 0.903494 | 0.976269 | 0.968505 | 0.84831 | 0.0534327 |
|
||||
| stacking_ensemble | 0.926948 | 0.89658 | 0.906173 | 0.901351 | 0.975479 | 0.967577 | 0.843381 | 0.0571918 |
|
||||
| xgboost | 0.926948 | 0.907191 | 0.893004 | 0.900041 | 0.974414 | 0.966573 | 0.842553 | 0.055568 |
|
||||
| catboost | 0.922401 | 0.902603 | 0.884774 | 0.893599 | 0.971655 | 0.963257 | 0.832643 | 0.0599482 |
|
||||
| torch_mlp | 0.919673 | 0.89849 | 0.881481 | 0.889904 | 0.962231 | 0.955303 | 0.826776 | 0.0646244 |
|
||||
| random_forest | 0.895726 | 0.873179 | 0.838683 | 0.855584 | 0.951964 | 0.934968 | 0.774426 | 0.0876372 |
|
||||
| logistic_regression | 0.881782 | 0.823529 | 0.864198 | 0.843373 | 0.943487 | 0.927548 | 0.749086 | 0.0878825 |
|
||||
| svm_rbf | 0.875417 | 0.845361 | 0.809877 | 0.827238 | 0.937322 | 0.914356 | 0.730302 | 0.091808 |
|
||||
| decision_tree | 0.837527 | 0.737912 | 0.866667 | 0.797123 | 0.921084 | 0.882933 | 0.669049 | 0.104353 |
|
||||
| knn | 0.81843 | 0.816222 | 0.654321 | 0.726359 | 0.880972 | 0.820862 | 0.601066 | 0.130555 |
|
||||
| gaussian_nb | 0.724159 | 0.805611 | 0.330864 | 0.469078 | 0.816222 | 0.721145 | 0.382749 | 0.273026 |
|
||||
| dummy_most_frequent | 0.631707 | 0 | 0 | 0 | 0.5 | 0.368293 | 0 | 0.368293 |
|
||||