From: <chr...@us...> - 2011-10-26 13:42:52
|
Revision: 3325 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3325&view=rev Author: christinaunger Date: 2011-10-26 13:42:40 +0000 (Wed, 26 Oct 2011) Log Message: ----------- [tbsl] added additional templates and ideal POS tags for NEs Modified Paths: -------------- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/converter/DRS2SPARQL_Converter.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/GrammarFilter.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/Preprocessor.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/sparql/SPARQL_Term.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/SlotBuilder.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/Templator.java trunk/components-ext/src/main/resources/tbsl/evaluation/dbpedia-test-questions-tagged(ideal).xml trunk/components-ext/src/main/resources/tbsl/evaluation/dbpedia-train-tagged(ideal).xml trunk/components-ext/src/main/resources/tbsl/lexicon/english.lex Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/converter/DRS2SPARQL_Converter.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/converter/DRS2SPARQL_Converter.java 2011-10-26 11:38:13 UTC (rev 3324) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/converter/DRS2SPARQL_Converter.java 2011-10-26 13:42:40 UTC (rev 3325) @@ -79,6 +79,9 @@ slots = ls; Query q = convert(drs, new Query(), false); + if (q == null) { + return null; + } q.setPrefixes(prefixes); template.setQuery(q); @@ -94,7 +97,9 @@ // System.out.println("--- DRS (before): " + drs); // DEBUG redundantEqualRenaming(drs); - restructureEmpty(drs); + if (!restructureEmpty(drs)) { + return null; + } // System.out.println("--- DRS (after) : " + drs); // DEBUG for (DiscourseReferent referent : drs.getDRs()) { @@ -379,7 +384,7 @@ } - private void restructureEmpty(DRS drs) { + private boolean restructureEmpty(DRS drs) { Set<Simple_DRS_Condition> emptyConditions = new HashSet<Simple_DRS_Condition>(); for (Simple_DRS_Condition c : drs.getAllSimpleConditions()) { @@ -387,30 +392,63 @@ emptyConditions.add(c); } } + if (emptyConditions.isEmpty()) { + return true; + } + boolean globalsuccess = false; for (Simple_DRS_Condition c : emptyConditions) { String nounToExpand = c.getArguments().get(1).getValue(); + String fallbackNoun = c.getArguments().get(0).getValue(); + boolean success = false; + loop: for (Simple_DRS_Condition sc : drs.getAllSimpleConditions()) { if (sc.getArguments().size() == 1 && sc.getArguments().get(0).getValue().equals(nounToExpand)) { - List<DiscourseReferent> newargs = new ArrayList<DiscourseReferent>(); - newargs.add(c.getArguments().get(0)); - newargs.add(sc.getArguments().get(0)); - sc.setArguments(newargs); for (Slot s : slots) { if (s.getAnchor().equals(sc.getPredicate())) { - s.setSlotType(SlotType.PROPERTY); - break; - } + if (s.getSlotType().equals(SlotType.CLASS)) { + s.setSlotType(SlotType.PROPERTY); + List<DiscourseReferent> newargs = new ArrayList<DiscourseReferent>(); + newargs.add(c.getArguments().get(0)); + newargs.add(sc.getArguments().get(0)); + sc.setArguments(newargs); + success = true; + globalsuccess = true; + break loop; + } + } } - break; } } + if (!success) { // do the same for fallbackNoun + loop: + for (Simple_DRS_Condition sc : drs.getAllSimpleConditions()) { + if (sc.getArguments().size() == 1 && sc.getArguments().get(0).getValue().equals(fallbackNoun)) { + for (Slot s : slots) { + if (s.getAnchor().equals(sc.getPredicate())) { + if (s.getSlotType().equals(SlotType.CLASS)) { + s.setSlotType(SlotType.PROPERTY); + List<DiscourseReferent> newargs = new ArrayList<DiscourseReferent>(); + newargs.add(c.getArguments().get(1)); + newargs.add(sc.getArguments().get(0)); + sc.setArguments(newargs); + success = true; + globalsuccess = true; + break loop; + } + } + } + } + } + } } - for (Simple_DRS_Condition c : emptyConditions) { - drs.removeCondition(c); + if (globalsuccess) { + for (Simple_DRS_Condition c : emptyConditions) { + drs.removeCondition(c); + } } - + return globalsuccess; } private boolean isUri(String arg) { Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/GrammarFilter.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/GrammarFilter.java 2011-10-26 11:38:13 UTC (rev 3324) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/GrammarFilter.java 2011-10-26 13:42:40 UTC (rev 3325) @@ -106,7 +106,7 @@ for (Pair<String,String> p : named) { try { - TreeNode tree = c.construct(p.getFirst().replaceAll("_"," ")); + TreeNode tree = c.construct(p.getFirst()); // .replaceAll("_"," ") int gid = grammar.addTree(grammar.size(), new Pair<String,TreeNode>(token,tree), Collections.singletonList(p.getSecond())); add(parseG, tree, gid-1, localID); @@ -277,7 +277,11 @@ private static List<Pair<String,String>> checkForNamedString(String token) { - String[] split = token.split(" "); + String[] split; + if (token.contains(" ")) { + split = token.split(" "); + } + else split = token.split("_"); if (split.length > 1 && split.length < 5) { @@ -292,6 +296,7 @@ semName += "_" + split[i]; rawNames += "DP:'" + split[i] + "' "; } + semName = semName.substring(1); out.add(new Pair<String,String>("(NP NP* ADJ:'"+ w +"' " + rawNames + ")", "<x,l1,<e,t>,[ l1:[ | SLOT_title(x,'" + semName + "') ] ], [],[],[ SLOT_title/PROPERTY/title^name ]>")); out.add(new Pair<String,String>("(DP DP* ADJ:'"+ w +"' " + rawNames + ")", "<x,l1,<<e,t>,t>,[ l1:[ | SLOT_title(x,'" + semName + "') ] ], [],[],[ SLOT_title/PROPERTY/title^name ]>")); Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/Preprocessor.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/Preprocessor.java 2011-10-26 11:38:13 UTC (rev 3324) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/Preprocessor.java 2011-10-26 13:42:40 UTC (rev 3325) @@ -81,6 +81,7 @@ Pattern vprepPattern = Pattern.compile("\\s((\\w+)/V[A-Z]+\\s\\w+/(IN|TO))"); Pattern whenPattern = Pattern.compile("(?i)(when/WRB\\s(.+\\s)(\\w+)/((V[A-Z]+)|(PASS[A-Z]+)))"); Pattern wherePattern = Pattern.compile("(?i)(where/WRB\\s(.+\\s)(\\w+)/((V[A-Z]+)|(PASS[A-Z]+)))"); + Pattern adjsPattern = Pattern.compile("((\\w+)/JJ.(\\w+)/JJ)"); Pattern adjnounPattern = Pattern.compile("((\\w+)(?<!many)/JJ.(\\w+)/NN(S)?)"); Pattern adjnprepPattern = Pattern.compile("((\\w+)(?<!many)/JJ.(\\w+)/NPREP)"); @@ -183,6 +184,11 @@ logger.trace("Replacing " + m.group(1) + " by " + m.group(2)+m.group(3)+"/WHERE"); condensedstring = condensedstring.replaceFirst(m.group(1),m.group(2) + m.group(3)+"/WHERE"); } + m = adjsPattern.matcher(condensedstring); + while (m.find()) { + logger.trace("Replacing " + m.group(1) + " by " + m.group(2)+"_"+m.group(3)+"/JJ"); + condensedstring = condensedstring.replaceFirst(m.group(1),m.group(2)+"_"+m.group(3)+"/JJ"); + } m = adjnounPattern.matcher(condensedstring); while (m.find()) { logger.trace("Replacing " + m.group(1) + " by " + m.group(2)+"_"+m.group(3)+"/JJNN"); Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/sparql/SPARQL_Term.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/sparql/SPARQL_Term.java 2011-10-26 11:38:13 UTC (rev 3324) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/sparql/SPARQL_Term.java 2011-10-26 13:42:40 UTC (rev 3325) @@ -97,7 +97,10 @@ else return "DESC(?"+alias.toLowerCase()+")"; } - if (isString() || isURI) { + if (isString()) { + return name.replaceAll("_"," "); + } + else if (isURI) { return name; } else return "?"+name.toLowerCase(); Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/SlotBuilder.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/SlotBuilder.java 2011-10-26 11:38:13 UTC (rev 3324) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/SlotBuilder.java 2011-10-26 13:42:40 UTC (rev 3325) @@ -124,7 +124,7 @@ else if (pos.equals("JJNPREP")) { String jjtoken = token.substring(0,token.indexOf("_")); String nntoken = token.substring(token.indexOf("_")+1); - String slotfluent = "SLOT_" + tokenfluent + "/" + type + "/" + token; + String slotfluent = "SLOT_" + tokenfluent + "/CLASS/" + token; String slotnn = "SLOT_" + nntoken + "/PROPERTY/" + nntoken; String slotnnc = "SLOT_" + nntoken + "/CLASS/" + nntoken; String slotjj = "SLOT_" + jjtoken + "/CLASS/" + jjtoken; @@ -148,15 +148,24 @@ result.add(npEntry); } else if(pos.equals("JJNN") && token.contains("_")) { - String jjtoken = token.substring(0,token.indexOf("_")); - String nntoken = token.substring(token.indexOf("_")+1); + String[] tokens = token.split("_"); + String nntoken = tokens[tokens.length-1]; String slotfluent = "SLOT_" + tokenfluent + "/CLASS/" + token; - String slotnn = "SLOT_" + nntoken + "/CLASS/" + nntoken; - String slotjj = "SLOT_" + jjtoken + "/CLASS/" + jjtoken; + String slotnn = "SLOT_" + nntoken + "/CLASS/" + nntoken; + String semantics = "<x,l1,<e,t>,[ l1:[ | SLOT_" + tokenfluent + "(x) ] ],[],[],[" + slotfluent + "]> " + + ";; <x,l1,<e,t>,[ l1:[ | SLOT_" + nntoken + "(x)"; + String slots = slotnn; + for (int i=0; i<(tokens.length-1); i++) { + semantics += ", SLOT_" + tokens[i] + "(x)"; + slots += ",SLOT_" + tokens[i] + "/CLASS/" + tokens[i]; + } + semantics += "] ],[],[],[" + slots + "]>"; + String[] npEntry = {token, "(NP " + treetoken + " )", - "<x,l1,<e,t>,[ l1:[ | SLOT_" + tokenfluent + "(x) ] ],[],[],[" + slotfluent + "]> ;; " + - "<x,l1,<e,t>,[ l1:[ | SLOT_" + nntoken + "(x), SLOT_" + jjtoken + "(x) ] ],[],[],[" + slotnn + "," + slotjj + "]>"}; + semantics }; +// "<x,l1,<e,t>,[ l1:[ | SLOT_" + tokenfluent + "(x) ] ],[],[],[" + slotfluent + "]> ;; " + +// "<x,l1,<e,t>,[ l1:[ | SLOT_" + nntoken + "(x), SLOT_" + jjtoken + "(x) ] ],[],[],[" + slotnn + "," + slotjj + "]>"}; result.add(npEntry); } @@ -165,13 +174,8 @@ else if (equalsOneOf(pos,verb)) { String slot; String symslot; - if (token.equals("has") || token.equals("have") || token.equals("had")) { - slot = "SLOT_" + token + "/PROPERTY/"; - symslot = "SLOT_" + token + "/SYMPROPERTY/"; - } - else { - slot = "SLOT_" + token + "/PROPERTY/" + token; - symslot = "SLOT_" + token + "/SYMPROPERTY/" + token; + slot = "SLOT_" + token + "/PROPERTY/" + token; + symslot = "SLOT_" + token + "/SYMPROPERTY/" + token; // List<String> preds = wordnet.getAttributes(token); // for (Iterator<String> i = preds.iterator(); i.hasNext();) { // slot += i.next(); @@ -181,7 +185,7 @@ // symslot += "^"; // } // } - } + if (pos.equals("PASSIVE")) { String[] passEntry1 = {token, "(S DP[subj] (VP V:'" + token + "' DP[obj]))", @@ -189,20 +193,36 @@ String[] passEntry2 = {token, "(S DP[wh] (VP DP[dp] V:'" + token + "'))", "<x,l1,t,[ l1:[|], l4:[ | SLOT_" + token + "(x,y) ] ],[(l2,x,wh,<<e,t>,t>),(l3,y,dp,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[" + symslot + "]>"}; + String[] passEntry1empty = {token, + "(S DP[subj] (VP V:'" + token + "' DP[obj]))", + "<x,l1,t,[ l1:[|], l4:[ | empty(y,x) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; + String[] passEntry2empty = {token, + "(S DP[wh] (VP DP[dp] V:'" + token + "'))", + "<x,l1,t,[ l1:[|], l4:[ | empty(x,y) ] ],[(l2,x,wh,<<e,t>,t>),(l3,y,dp,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; result.add(passEntry1); result.add(passEntry2); + result.add(passEntry1empty); + result.add(passEntry2empty); } else if (pos.equals("PASSPART")) { String[] passpartEntry = {token, "(NP NP* (VP V:'" + token + "' DP[dp]))", - "<x,l1,t,[ l1:[ | SLOT_" + token + "(y,x) ] ],[(l2,y,dp,<<e,t>,t>)],[ l2=l1 ],[" + symslot + "]>"}; + "<x,l1,t,[ l1:[ | SLOT_" + token + "(y,x) ] ],[(l2,y,dp,<<e,t>,t>)],[ l2=l1 ],[]>"}; + String[] passpartEntryEmpty = {token, + "(NP NP* (VP V:'" + token + "' DP[dp]))", + "<x,l1,t,[ l1:[ | empty(y,x) ] ],[(l2,y,dp,<<e,t>,t>)],[ l2=l1 ],[]>"}; result.add(passpartEntry); + result.add(passpartEntryEmpty); } else if (pos.equals("VPASS")) { String[] passEntry = {token, "(S DP[subj] (VP V:'" + token + "'))", "<x,l1,t,[ l1:[|], l4:[ | SLOT_" + token + "(y,x) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[" + symslot + "]>"}; + String[] passEntryEmpty = {token, + "(S DP[subj] (VP V:'" + token + "'))", + "<x,l1,t,[ l1:[|], l4:[ | empty(y,x) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; result.add(passEntry); + result.add(passEntryEmpty); } else if (pos.equals("VPASSIN")) { String[] passEntry1 = {token, @@ -221,8 +241,16 @@ String[] gerundinEntry2 = {token, "(ADJ V:'" + token + "' DP[obj]))", "<x,l1,<e,t>,[ l1:[ | SLOT_" + token + "(x,y) ] ],[(l2,y,obj,<<e,t>,t>)],[ l2=l1 ],[" + symslot + "]>"}; + String[] gerundinEntry1Empty = {token, + "(NP NP* V:'" + token + "' DP[obj]))", + "<x,l1,t,[ l1:[ | empty(x,y) ] ],[(l2,y,obj,<<e,t>,t>)],[ l2=l1 ],[]>"}; + String[] gerundinEntry2Empty = {token, + "(ADJ V:'" + token + "' DP[obj]))", + "<x,l1,<e,t>,[ l1:[ | empty(x,y) ] ],[(l2,y,obj,<<e,t>,t>)],[ l2=l1 ],[]>"}; result.add(gerundinEntry1); result.add(gerundinEntry2); + result.add(gerundinEntry1Empty); + result.add(gerundinEntry2Empty); } else if (pos.equals("VPREP")) { String[] passEntry = {token, @@ -231,26 +259,46 @@ String[] whEntry = {token, "(S DP[obj] (VP DP[subj] V:'" + token + "'))", "<x,l1,t,[ l1:[|], l4:[ | SLOT_" + token + "(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[" + symslot + "]>"}; + String[] passEntryEmpty = {token, + "(S DP[subj] (VP V:'" + token + "' DP[obj]))", + "<x,l1,t,[ l1:[|], l4:[ | empty(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; + String[] whEntryEmpty = {token, + "(S DP[obj] (VP DP[subj] V:'" + token + "'))", + "<x,l1,t,[ l1:[|], l4:[ | empty(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; result.add(passEntry); result.add(whEntry); + result.add(passEntryEmpty); + result.add(whEntryEmpty); } else if (pos.equals("VBD") || pos.equals("VBZ") || pos.equals("VBP")) { String[] vEntry = {token, "(S DP[subj] (VP V:'" + token + "' DP[obj]))", "<x,l1,t,[ l1:[|], l4:[ | SLOT_" + token + "(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[" + symslot + "]>"}; + String[] vEntryEmpty = {token, + "(S DP[subj] (VP V:'" + token + "' DP[obj]))", + "<x,l1,t,[ l1:[|], l4:[ | empty(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; result.add(vEntry); + result.add(vEntryEmpty); } else if (pos.equals("VB")) { String[] whEntry = {token, "(S DP[obj] (VP DP[subj] V:'" + token + "'))", "<x,l1,t,[ l1:[|], l4:[ | SLOT_" + token + "(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[" + symslot + "]>"}; + String[] whEntryEmpty = {token, + "(S DP[obj] (VP DP[subj] V:'" + token + "'))", + "<x,l1,t,[ l1:[|], l4:[ | empty(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; result.add(whEntry); + result.add(whEntryEmpty); } else if (pos.equals("VBG") || pos.equals("VBN")) { String[] gerEntry = {token, "(NP NP* (VP V:'" + token + "' DP[dp]))", "<x,l1,t,[ l1:[ | SLOT_" + token + "(x,y) ] ],[(l2,y,dp,<<e,t>,t>)],[ l2=l1 ],[" + symslot + "]>"}; + String[] gerEntryEmpty = {token, + "(NP NP* (VP V:'" + token + "' DP[dp]))", + "<x,l1,t,[ l1:[ | empty(x,y) ] ],[(l2,y,dp,<<e,t>,t>)],[ l2=l1 ],[]>"}; result.add(gerEntry); + result.add(gerEntryEmpty); } else if (pos.equals("WHEN")) { String dateSlot = "SLOT_" + token + "/PROPERTY/" + token + "Date"; @@ -349,7 +397,11 @@ String[] npAdjunct = {token, "(NP NP* (PP P:'" + token.toLowerCase() + "' DP[pobj]))", "<x,l1,<e,t>,[ l1:[ | SLOT_" + token + "(x,y) ] ],[(l2,y,pobj,<<e,t>,t>)],[l2=l1],["+slot+"]>"}; + String[] npAdjunctEmpty = {token, + "(NP NP* (PP P:'" + token.toLowerCase() + "' DP[pobj]))", + "<x,l1,<e,t>,[ l1:[ | empty(x,y) ] ],[(l2,y,pobj,<<e,t>,t>)],[l2=l1],[]>"}; result.add(npAdjunct); + result.add(npAdjunctEmpty); } } Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/Templator.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/Templator.java 2011-10-26 11:38:13 UTC (rev 3324) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/Templator.java 2011-10-26 13:42:40 UTC (rev 3325) @@ -137,16 +137,19 @@ if (!containsModuloRenaming(drses,drs)) { // // DEBUG - System.out.println(dude); - System.out.println(drs); - for (Slot sl : slots) { - System.out.println(sl.toString()); - } +// System.out.println(dude); +// System.out.println(drs); +// for (Slot sl : slots) { +// System.out.println(sl.toString()); +// } // // drses.add(drs); try { Template temp = d2s.convert(drs,slots); + if (temp == null) { + continue; + } // find WordNet synonyms List<String> newwords; Modified: trunk/components-ext/src/main/resources/tbsl/evaluation/dbpedia-test-questions-tagged(ideal).xml =================================================================== --- trunk/components-ext/src/main/resources/tbsl/evaluation/dbpedia-test-questions-tagged(ideal).xml 2011-10-26 11:38:13 UTC (rev 3324) +++ trunk/components-ext/src/main/resources/tbsl/evaluation/dbpedia-test-questions-tagged(ideal).xml 2011-10-26 13:42:40 UTC (rev 3325) @@ -3,7 +3,7 @@ <string>Which/WDT presidents/NNS of/IN the/DT United/NNP States/NNPS had/VBD more/JJR than/IN three/CD children/NNS</string> </question> <question id="3"> -<string>Give/VB me/PRP the/DT official/JJ websites/NNS of/IN actors/NNS of/IN the/DT television/NN show/NN Charmed/VBN</string> +<string>Give/VB me/PRP the/DT official/JJ websites/NNS of/IN actors/NNS of/IN the/DT television/NN show/NN Charmed/NNP</string> </question> <question id="37"> <string>Who/WP is/VBZ the/DT daughter/NN of/IN Bill/NNP Clinton/NNP married/VBN to/TO</string> Modified: trunk/components-ext/src/main/resources/tbsl/evaluation/dbpedia-train-tagged(ideal).xml =================================================================== --- trunk/components-ext/src/main/resources/tbsl/evaluation/dbpedia-train-tagged(ideal).xml 2011-10-26 11:38:13 UTC (rev 3324) +++ trunk/components-ext/src/main/resources/tbsl/evaluation/dbpedia-train-tagged(ideal).xml 2011-10-26 13:42:40 UTC (rev 3325) @@ -2031,7 +2031,7 @@ </answers> </question> <question id="37"> -<string>List/VB all/DT episodes/NNS of/IN the/DT first/JJ season/NN of/IN the/DT HBO/NNP television/NN series/NN The/DT Sopranos/NNPS</string> +<string>List/VB all/DT episodes/NNS of/IN the/DT first/JJ season/NN of/IN the/DT HBO/NNP television/NN series/NN The/NNP Sopranos/NNPS</string> <query> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX onto: <http://dbpedia.org/ontology/> @@ -19886,7 +19886,7 @@ </answers> </question> <question id="33"> -<string>Which/WDT music/NN albums/NNS contain/VBP the/DT song/NN Last/JJ Christmas/NNP</string> +<string>Which/WDT music/NN albums/NNS contain/VBP the/DT song/NN Last/NNP Christmas/NNP</string> <query> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> @@ -26155,7 +26155,7 @@ </answers> </question> <question id="39"> -<string>Who/WP wrote/VBD the/DT book/NN The/DT pillars/NNS of/IN the/DT Earth/NNP</string> +<string>Who/WP wrote/VBD the/DT book/NN The/NNP pillars/NNP of/NNP the/NNP Earth/NNP</string> <query> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> Modified: trunk/components-ext/src/main/resources/tbsl/lexicon/english.lex =================================================================== --- trunk/components-ext/src/main/resources/tbsl/lexicon/english.lex 2011-10-26 11:38:13 UTC (rev 3324) +++ trunk/components-ext/src/main/resources/tbsl/lexicon/english.lex 2011-10-26 13:42:40 UTC (rev 3325) @@ -101,9 +101,12 @@ has || (S DP[subject] (VP V:'has' DP[object])) || <x, l1, t, [ l1:[ | ], l2:[ | empty(x,y) ] ], [ (l3,x,subject,<<e,t>,t>), (l4,y,object,<<e,t>,t>) ], [ l3<l1, l4<l1, l2<scope(l3), l2<scope(l4) ],[]> have || (S DP[subject] (VP V:'have' DP[object])) || <x, l1, t, [ l1:[ | ], l2:[ | empty(x,y) ] ], [ (l3,x,subject,<<e,t>,t>), (l4,y,object,<<e,t>,t>) ], [ l3<l1, l4<l1, l2<scope(l3), l2<scope(l4) ],[]> + had || (S DP[subject] (VP V:'had' DP[object])) || <x, l1, t, [ l1:[ | ], l2:[ | empty(x,y) ] ], [ (l3,x,subject,<<e,t>,t>), (l4,y,object,<<e,t>,t>) ], [ l3<l1, l4<l1, l2<scope(l3), l2<scope(l4) ],[]> - with || (NP NP* (PP P:'with' DP[dp])) || <x,l1,<e,t>,[ l1:[| empty(x,y) ] ],[(l2,y,dp,<<e,t>,t>)],[l2=l1],[]> +// with || (NP NP* (PP P:'with' DP[dp])) || <x,l1,<e,t>,[ l1:[| empty(x,y) ] ],[(l2,y,dp,<<e,t>,t>)],[l2=l1],[]> + people || (NP N:'people') || <x,l1,<e,t>,[ l1:[|] ],[],[],[]> + // WH WORDS // -------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |