CogComp / saul

Saul : Declarative Learning-Based Programming
Other
64 stars 18 forks source link

List[Double] properties with order #289

Open kordjamshidi opened 8 years ago

kordjamshidi commented 8 years ago

When using the properties of type List[Double] if we want to respect the order of the features what we should do, this is real[] in lbjava vs. real% , I guess our implementation only supports real%? I see that in RealPrimitiveStringFeature(String p, String c, String i, double v) we pass empty i, which is the distinguishing identifier between real features.

danyaljj commented 8 years ago

I think you're looking for this? https://github.com/IllinoisCogComp/saul/blob/master/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/DataModel.scala#L216

Add ordered = true to your signature to use ordered. Here is a sample: https://github.com/IllinoisCogComp/saul/blob/master/saul-core/src/test/scala/edu/illinois/cs/cogcomp/saul/datamodel/propertyTest.scala#L81-L83

kordjamshidi commented 8 years ago

Yes, that should be it, right. But now I test it I am not sure how this flag influences the final feature values because even by adding the order= true i see the identifier of the feature is empty and package name + property name is used for all? Maybe I am wrong but how did you tested this ordered real features?

danyaljj commented 8 years ago

I have never carefully looked into these properties; I just moved the old properties into this unified structure...

kordjamshidi commented 8 years ago

Ok, I myself worked on it before, I should have my lbjava generated examples for this, try to figure it out, Thanks.