clay-lab / logos Goto Github PK
View Code? Open in Web Editor NEWTranslating sentences into logical forms
Translating sentences into logical forms
Right now, the definition for the single reflexive 'Himself' is not parsed correctly. We should fix that.
Complex semantic representations involving quantifiers, lambda expressions, and so forth, require the use of variables. Compare the following sentences and their parses.
Alice sees Bob see ( alice , bob )
Everyone sees Alice all x . ( person ( x ) -> see ( x , alice ) )
Everyone sees Everyone all x . ( person ( x ) -> all z1 . ( person ( z1 ) -> see ( x , z1 ) ) )
The symbols x
and z1
in the previous expressions are variables. It's difficult for the network to determine these symbols since they aren't deterministic based on the input, but rather on what sentences were previously generated by the grammar. To get around this, we could opt for nameless variables, like De Bruijn indices, or require that all variables be numbers and then resetting the counter (somehow?) so that they are deterministic.
Turn the semrep
object produced for each sentence into an nltk
Tree
object that can be thrown into a TreeDecoder.
Right now, the semrep
for a sentence doesn't have any spaces around the functional symbols. For example,
Alice sees Bob -> sees(alice,bob)
We want to include spaces before and after these symbols to make Seq2Seq
translation easier, so the same sentence should look like
Alice sees Bob -> sees ( alice , bob )
The best way to do this is probably to override the __format__
method of ApplicationExpression
(the type of semrep
).
Commit 6fd57de formats Expression
output to have spaces around each functional symbol. This is accomplished by swizzling the __str__
methods on several subclasses of Expression
. This fix is brittle for two reasons.
__str__
methods on each of these Expression
subclasses affects the others; adding a space to one may mean that we have extra spaces in the final output.Expression
to the semrep results in new formats which haven't yet been swizzled.Therefore, it is imperative that we create a set of unit tests which verify (1) that no extraneous spaces have been added to the output and (2) confirm that every new type of expression is not broken in the future. We may also want to add some kind of check for an output file to independently verify that there are no adjacent functional symbols, though this may be an undefinable problem due to the confusion of, say, a variable x
and a symbol beginning with x
, like xylophone
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.