Giter VIP home page Giter VIP logo

psl-examples's People

Contributors

almumill avatar cfpryor avatar dickensc avatar eriq-augustine avatar iamvibin avatar shrestabs avatar thachandrew avatar vihanggodbole avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

psl-examples's Issues

Potentially wrong inference results on Yelp dataset.

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.

NullPointerException on Yelp inference when run with -satisfaction

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

Question regarding the use of "predicate_closed=True" in the examples

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.

LR Baseline

For one real-data example, make a LR baseline.

Maybe include these variants:

  • LR Baseline
  • LR w/ Pairwise Features (these features proxy ground atoms)
  • PSL w/o Collective Rules (should match LR baseline)

Scripts to Run Examples

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:

  • Run examples.
  • Run examples without weight learning.
  • Setup psl-examples (fetch and rewrite options).

A question about simple-acquaintances

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.