Uses 911K of libraries. Click here for Pure Java version (2723L/15K).
!7 cmodule Spike > DynPrintLog { start-thread { // Often people can't see well in a concert when someone tall is in front of them. S s = winograd_takeFirstOption( "John couldn't see the stage with Billy in front of him because he is so [short/tall]. Who is so [short/tall]?"); //LS sentences = sentences(s); LS tok = javaTok(s); Set<S> names = dm_getUnclearListAsCISet("First names"); Set<S> pronouns = dm_getUnclearListAsCISet("Pronouns"); Set<S> foundNames = ciSet(); for (int i = 1; i < l(tok); i += 2) { S t = tok.get(i); print(t); if (contains(names, t)) { print(" NAME"); foundNames.add(t); } if (contains(pronouns, t)) print(" PRONOUN. May be one of: " + foundNames); } } }
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1027103 |
| Snippet name: | Winograd Pronoun Resolution Spike |
| Eternal ID of this version: | #1027103/4 |
| Text MD5: | 2cfc55eec9a7705ce9b3eb51702a63c2 |
| Transpilation MD5: | 6d9c94b8692faefa69222236a393534e |
| Author: | stefan |
| Category: | javax / a.i. |
| Type: | JavaX source code (Dynamic Module) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-02-19 14:58:45 |
| Source code size: | 790 bytes / 23 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 499 / 1059 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |