linqs / psl-examples Goto Github PK
View Code? Open in Web Editor NEWVarious examples to showcase the functionality of PSL.
Various examples to showcase the functionality of PSL.
Hi, so I was recently analyzing the grounded rule results while running ./run.sh script with --satisfaction argument on the yelp dataset and comparing them with my implementation of the Łukasiewicz implication operator. I get some mismatches.
For example, this one:
0.93733215 false ( ~( SIM_CONTENT_ITEMS_JACCARD('2419', '3212') ) | ~( RATED('1538', '3212') ) | ~( RATING('1538', '2419') ) | ~( RATED('1538', '2419') ) | RATING('1538', '3212') ) 0.9905105829238892
Which could be rewritten as:
SIM_CONTENT_ITEMS_JACCARD('2419', '3212') & RATED('1538', '3212') & RATING('1538', '2419') & RATED('1538', '2419') => RATING('1538', '3212')
If we ground each atom according to the files in data/yelp/0/eval we get the following:
1 & 1 & 1.0 & 1 => RATING('1538', '3212')
The MAP estimate of RATING('1538', '3212') is 0.7889187 (according to the inference RATING.txt file)
So the evaluation of the following formula should be equal to:
1 & 1 & 1.0 & 1 => 0.7889187 ~ 0.7889187 instead of 0.9905105829238892.
Since SIM_CONTENT_ITEMS_JACCARD and RATED are always evaluated to 1, I bet there might be a problem with grounding the atom RATING('1538', '2419'), which according to the file data/yelp/0/eval/rating_truth.txt, is equal to 1.0. I bet it grounds it to 0.8 for some reason, but I could be wrong.
Unexpected exception!
java.lang.NullPointerException
at org.linqs.psl.cli.Launcher.outputGroundRules(Launcher.java:155)
at org.linqs.psl.cli.Launcher.learnWeights(Launcher.java:290)
at org.linqs.psl.cli.Launcher.run(Launcher.java:402)
at org.linqs.psl.cli.Launcher.main(Launcher.java:466)
at org.linqs.psl.cli.Launcher.main(Launcher.java:454)
ERROR: Failed to run weight learning
I get this error when running:
./run.sh -satisdaction
on Windows 10 and also on Windows 10 subsystem for Ubuntu.
I do not get this error while running simple-acquaintances for example
I have been reviewing the examples provided in the project and noticed that in all the examples, the predicate is consistently set as "predicate_closed=True". I would like to understand the rationale behind this choice and its implications for the project.
Could you example whether it should to distinguish the predicate as open or closed? Why the target predicate also set as "open"? Could you please provide some insights? Thanks a lot.
Once we have CI and tests, implement some tests that check for quotes.
Hi, I am inexperience in Java. On the help website https://psl.linqs.org/blog/2018/07/15/getting-started-with-psl.html. We can use psl-cli.jar to run our own .data and .psl with
java -jar psl-cli.jar --infer --model [name of model file].psl --data [name of data file].data
Where is this psl-cli.jar located in the psl-example github? Thanks.
For one real-data example, make a LR baseline.
Maybe include these variants:
We should provide scripts that run several examples in some canonical way.
This is essentially the same script that can be used to run experiments.
Maybe have:
Hey,
Great work, thanks for your code!
However, as a beginner and someone unfamiliar with Java, I have encountered some very basic questions, but they have indeed troubled me. I look forward to your answers!
When I was running the code for simple-acquaintances that you provided, it worked fine according to the data you provided. However, I found that if I added a pair of data (such as 0 16) to "knows_targets ", the following error would be reported:
'''
java.lang.RuntimeException: java.lang.RuntimeException: com.fasterxml.jackson.databind.JsonMappingException: Non-standard token 'NaN': enable JsonReadFeature.ALLOW_NON_NUMERIC_NUMBERS
to allow
at [Source: (String)"{"options": {"runtime.log.level": "INFO", "runtime.learn": false, "runtime.inference": true, "runtime.inference.output.results": false}, "rules": ["5.000000: Knows(P1, P2) & Knows(P2, P3) & (P1 != P3) -> Knows(P1, P3) ^2"], "predicates": {"KNOWS": {"name": "KNOWS", "arity": 2, "types": ["UniqueStringID", "UniqueStringID"], "observations": [[0, 2, 1.0], [0, 3, 1.0], [0, 4, 1.0], [0, 5, 1.0], [0, 6, 0.0], [0, 8, 1.0], [0, 9, 1.0], [0, 10, 1.0], [0, 11, 1.0], [0, 12, 1.0], [0, 13, 1.0], [0, 14, 1.0"[truncated 17118 chars]; line: 1, column: 7273] (through reference chain: org.linqs.psl.runtime.RuntimeConfig$JSONRuntimeConfig["predicates"]->java.util.LinkedHashMap["KNOWS"]->org.linqs.psl.runtime.RuntimeConfig$JSONPredicate["targets"])
ERROR: Failed to run.
'''
According to my understanding, simply adding a pair of data to calculate the probability should not result in errors. Is there anything I did not understand, or what are the necessary requirements for building a dataset? I am eager to know this information!
Looking forward to your reply very much, thank you!
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.