Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

32
LINES

< > BotCompany Repo | #1027125 // Winograd Multi-Stage Base Code [dev.]

JavaX (incomplete)

S input = "Bob paid for Charlie's college education. He is very [generous/grateful]. Who is [generous/grateful]?";
S multiStage = dm_showNewModule("#1027106/MultiStageProcessing");

// Stage 1: take first option out of square brackets
S input2 = winograd_takeFirstOption(input);
dm_call(multiStage, 'addStage, "Take first option", input2);

// Stage 1b: Split off 's
S input2b = ai_splitOffApostropheS(input);
dm_call(multiStage, 'addStage, "Split off 's", input2b);

// Stage 2: Split into sentences
LS sentences = sentences(input2b);
dm_call(multiStage, 'addStage, "Split into sentences", sentences);

// Stage 2b: Apply patterns to sentences
S parser = dm_makeModule("#1027108/TopDownParsing");
L<virtual TryPatterns> parsed = map(sentences, s -> dm_call(parser, 'parse, s));
dm_call(multiStage, 'addStage, "Apply patterns", parsed);

// Stage 2c: Ask user questions to check validity of assumptions

// Stage 3: Find strong words in input
// [Stage 3: Identify actors in input (people or things)]

// Stage 4: Find a useful scenario in DB

// Stage 5: Map scenario to input

// Stage 6: Identify and answer question

//dm_showListWithFeedback(func -> LS { sentences(input) }, info := litorderedmap(+input));

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: #1027125
Snippet name: Winograd Multi-Stage Base Code [dev.]
Eternal ID of this version: #1027125/1
Text MD5: 655ea2cd82fedadaf75c2137748f0491
Author: stefan
Category: javax / a.i.
Type: JavaX (incomplete)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-21 12:58:03
Source code size: 1242 bytes / 32 lines
Pitched / IR pitched: No / No
Views / Downloads: 166 / 192
Referenced in: [show references]