Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do you have GALAGO version of query? #2

Open
wujy2015 opened this issue Jan 3, 2018 · 7 comments
Open

Do you have GALAGO version of query? #2

wujy2015 opened this issue Jan 3, 2018 · 7 comments

Comments

@wujy2015
Copy link

wujy2015 commented Jan 3, 2018

No description provided.

@fedorn
Copy link

fedorn commented Jan 3, 2018

Hi Junyan,
You can try to use #combine operator instead of #weight, specifying weights as it shown here.
Instead of #od4 you should use #od:4, and instead of #uw17 you should use #uw:17.

@wujy2015
Copy link
Author

wujy2015 commented Jan 4, 2018

Thank you! Do you mind to tell me how you index the documents?

@balaneshin
Copy link
Contributor

balaneshin commented Jan 4, 2018

You can build a galago index by downloading the collection from the provided link in the readme file. The filetype is trectext, and you can easily build a galago index by following the same steps as here. Please choose the same configurations (e.g., the same stemmer) as here in building the galago index.

@wujy2015
Copy link
Author

wujy2015 commented Jan 5, 2018

Hi Thanks for your reply!
I try to convert the first query to GALAGO, but I got an exception.

Here is my query:
{"queries":[{"number":"1",
"text":"#combine 0=0.95:1=0.05(
#combine(
A 44 yo male is brought to the emergency room after multiple bouts of vomiting that has a coffee ground appearance His heart rate is 135 bpm and blood pressure is 70 40 mmHg Physical exam findings include decreased mental status and cool extremities He receives a rapid infusion of crystalloid solution followed by packed red blood cell transfusion and is admitted to the ICU for further care
)
#combine 0=1:1=1:2=1(
#combine 0=0.4:1=0.1:2=0.5(
#combine( vomiting )
#combine( #od:4(vomiting) )
#uw:17( vomiting )
)
#combine 0=0.4:1=0.1:2=0.35(
#combine( grind )
#combine( #od:4(grind) )
#uw:17( grind )
)
#combine 0=0.4:1=0.1:2=0.35(
#combine( packed red blood cell transfusion )
#combine( #od:4(packed red) #od:4(red blood) #od:4(blood cell) #od:4(cell transfusion) )
#uw:17( packed red blood cell transfusion )
)
)
)"
},
]
}

Here is the exception:
Exception in thread "main" java.lang.AssertionError
at org.lemurproject.galago.core.retrieval.traversal.InsideToFieldPartTraversal.afterNode(InsideToFieldPartTraversal.java:56)
at org.lemurproject.galago.core.retrieval.traversal.Traversal.traverse(Traversal.java:34)
at org.lemurproject.galago.core.retrieval.traversal.Traversal.traverse(Traversal.java:32)
at org.lemurproject.galago.core.retrieval.LocalRetrieval.transformQuery(LocalRetrieval.java:322)
at org.lemurproject.galago.core.retrieval.LocalRetrieval.transformQuery(LocalRetrieval.java:315)
at org.lemurproject.galago.core.tools.apps.BatchSearch.run(BatchSearch.java:138)
at org.lemurproject.galago.utility.tools.AppFunction.run(AppFunction.java:62)
at org.lemurproject.galago.core.tools.App.run(App.java:96)
at org.lemurproject.galago.core.tools.App.run(App.java:87)
at org.lemurproject.galago.core.tools.App.main(App.java:83)
I use GALAGO 3.11. Do you have any idea why this happens?

@wujy2015
Copy link
Author

wujy2015 commented Jan 5, 2018

I change to this:
{"queries":[{"number":"1",
"text":"#combine: 0=0.95:1=0.05(
#combine:(
A 44 yo male is brought to the emergency room after multiple bouts of vomiting that has a coffee ground appearance His heart rate is 135 bpm and blood pressure is 70 40 mmHg Physical exam findings include decreased mental status and cool extremities He receives a rapid infusion of crystalloid solution followed by packed red blood cell transfusion and is admitted to the ICU for further care
)
#combine: 0=1:1=1:2=1(
#combine: 0=0.4:1=0.1:2=0.5(
#combine:( vomiting )
#combine:( #od:4(vomiting) )
#uw:17( vomiting )
)
#combine: 0=0.4:1=0.1:2=0.35(
#combine:( grind )
#combine:( #od:4(grind) )
#uw:17( grind )
)
#combine: 0=0.4:1=0.1:2=0.35(
#combine:( packed red blood cell transfusion )
#combine:( #od:4(packed red) #od:4(red blood) #od:4(blood cell) #od:4(cell transfusion) )
#uw:17( packed red blood cell transfusion )
)
)
)"
},
]
}

But got:

./core/target/appassembler/bin/galago batch-search --index=/Volumes/JUNYAN/GP_new_doc_idx test1.txt
Exception in thread "main" java.lang.AssertionError: Node parameters contains duplicate 'default' key. Failed to parseParameters().
at org.lemurproject.galago.core.retrieval.query.StructuredQuery.parseParameters(StructuredQuery.java:59)
at org.lemurproject.galago.core.retrieval.query.StructuredQuery.parseOperator(StructuredQuery.java:85)
at org.lemurproject.galago.core.retrieval.query.StructuredQuery.parseUnrestricted(StructuredQuery.java:129)
at org.lemurproject.galago.core.retrieval.query.StructuredQuery.parseRestricted(StructuredQuery.java:163)
at org.lemurproject.galago.core.retrieval.query.StructuredQuery.parseArgument(StructuredQuery.java:185)
at org.lemurproject.galago.core.retrieval.query.StructuredQuery.parseArgumentList(StructuredQuery.java:208)
at org.lemurproject.galago.core.retrieval.query.StructuredQuery.parseOperator(StructuredQuery.java:92)
at org.lemurproject.galago.core.retrieval.query.StructuredQuery.parseUnrestricted(StructuredQuery.java:129)
at org.lemurproject.galago.core.retrieval.query.StructuredQuery.parseRestricted(StructuredQuery.java:163)
at org.lemurproject.galago.core.retrieval.query.StructuredQuery.parseArgument(StructuredQuery.java:185)
at org.lemurproject.galago.core.retrieval.query.StructuredQuery.parseArgumentList(StructuredQuery.java:208)
at org.lemurproject.galago.core.retrieval.query.StructuredQuery.parseOperator(StructuredQuery.java:92)
at org.lemurproject.galago.core.retrieval.query.StructuredQuery.parseUnrestricted(StructuredQuery.java:129)
at org.lemurproject.galago.core.retrieval.query.StructuredQuery.parseRestricted(StructuredQuery.java:163)
at org.lemurproject.galago.core.retrieval.query.StructuredQuery.parseArgument(StructuredQuery.java:185)
at org.lemurproject.galago.core.retrieval.query.StructuredQuery.parseArgumentList(StructuredQuery.java:208)
at org.lemurproject.galago.core.retrieval.query.StructuredQuery.parseOperator(StructuredQuery.java:92)
at org.lemurproject.galago.core.retrieval.query.StructuredQuery.parseUnrestricted(StructuredQuery.java:129)
at org.lemurproject.galago.core.retrieval.query.StructuredQuery.parseRestricted(StructuredQuery.java:163)
at org.lemurproject.galago.core.retrieval.query.StructuredQuery.parseArgument(StructuredQuery.java:185)
at org.lemurproject.galago.core.retrieval.query.StructuredQuery.parseArgumentList(StructuredQuery.java:208)
at org.lemurproject.galago.core.retrieval.query.StructuredQuery.parse(StructuredQuery.java:224)
at org.lemurproject.galago.core.tools.apps.BatchSearch.run(BatchSearch.java:126)
at org.lemurproject.galago.utility.tools.AppFunction.run(AppFunction.java:62)
at org.lemurproject.galago.core.tools.App.run(App.java:96)
at org.lemurproject.galago.core.tools.App.run(App.java:87)
at org.lemurproject.galago.core.tools.App.main(App.java:83)

@balaneshin
Copy link
Contributor

balaneshin commented Jan 5, 2018

@wujy2015 Can you try to run galago batch-search for the following json file. There was some mistake in the query language:

{
   "index":"/scratch/index/galago/pmc_galago_small/",
   "queries":
      [{"number":"1",
         "text":"#combine:0=0.95:1=0.05(
            #combine(
               A 44 yo male is brought to the emergency room after multiple bouts of vomiting that has a coffee ground appearance His heart rate is 135 bpm and blood pressure is 70 40 mmHg Physical exam findings include decreased mental status and cool extremities He receives a rapid infusion of crystalloid solution followed by packed red blood cell transfusion and is admitted to the ICU for further care
            )
            #combine:0=1:1=1:2=1(
               #combine:0=0.4:1=0.1:2=0.5(
                  #combine( vomiting )
                  #combine( #od:4(vomiting) )
                  #uw:17( vomiting )
               )
               #combine:0=0.4:1=0.1:2=0.35(
                  #combine( grind )
                  #combine( #od:4(grind) )
                  #uw:17( grind )
               )
               #combine:0=0.4:1=0.1:2=0.35(
                  #combine( packed red blood cell transfusion )
                  #combine( #od:4(packed red) #od:4(red blood) #od:4(blood cell) #od:4(cell transfusion) )
                  #uw:17( packed red blood cell transfusion )
               )
            )
         )"
      }]
}

@wujy2015
Copy link
Author

wujy2015 commented Jan 9, 2018

It works! Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants