Update documentation for collocationScoreQuery
Change-Id: I3a405963c4b19f81c844260dcaa93087efe26fb4
diff --git a/KorAPClient/__init__.py b/KorAPClient/__init__.py
index 3de5813..1cbbef1 100644
--- a/KorAPClient/__init__.py
+++ b/KorAPClient/__init__.py
@@ -88,33 +88,26 @@
return KorAPClient.frequencyQuery(self, *args, **kwargs)
def collocationScoreQuery(self, *args, **kwargs):
- """Query relative frequency of search term(s).
+ """Get collocation scores for given node(s) and collocate(s).
- - **query** - query string or list of query strings
+ - **node** - target word
+ - **collocate** - collocate of target word
- **vc** - virtual corpus definition or list thereof (default: "")
- - **conf.level** - confidence level of the returned confidence interval (default = 0.95)
- - **as.alternatives** - decides whether queries should be treated as mutually exclusive and exhaustive wrt. to some meaningful class (e.g. spelling variants of a certain word form) (default = False)
- - **KorAPUrl** - instead of specifying the `query` and `vc` string parameters, you can copy your KorAP query URL here from the browser
- - **metadataOnly** - determines whether queries should return only metadata without any snippets. This can also be useful to prevent access rewrites. (default = True)
- - **ql** - query language: `"poliqarp" | "cosmas2" | "annis" | "cql" | "fcsql"` (default = `"poliqarp"`)
- - **accessRewriteFatal** - abort if query or given vc had to be rewritten due to insufficient rights (not yet implemented) (default = `True`)
- - **verbose** - (default = `self.verbose`)
- - **expand** - bool that decides if `query` and `vc` parameters are expanded to all of their combinations (default = `len(vc) != len(query)`)
+ - **lemmatizeNodeQuery** - logical, set to TRUE if node query should be lemmatized, i.e. x -> [tt/l=x]
+ - **lemmatizeCollocateQuery** - logical, set to TRUE if collocate query should be lemmatized, i.e. x -> [tt/l=x]
+ - **leftContextSize** - size of the left context window
+ - **rightContextSize** - size of the right context window
+ - **scoreFunctions** - named list of score functions of the form function(O1, O2, O, N, E, window_size), see e.g. pmi
+ - smoothingConstant - smoothing constant will be added to all observed values
Returns:
- DataFrame with columns `'query', 'totalResults', 'vc', 'webUIRequestUrl', 'total', 'f',
- 'conf.low', 'conf.high'`.
+ DataFrame with columns `'node', 'collocate', 'label', 'vc','webUIRequestUrl', 'w', 'leftContextSize',
+ 'rightContextSize', 'N', 'O', 'O2', 'E', 'pmi', 'mi2', 'mi3', 'logDice' `
Example:
```
$ kcon = KorAPConnection(verbose=True)
- $ kcon.frequencyQuery("Ameisenplage", vc=["pubDate in "+str(y) for y in range(2010,2015)])
- query totalResults ... conf.low conf.high
- 1 Ameisenplage 3 ... 9.727696e-10 1.200289e-08
- 2 Ameisenplage 12 ... 3.838218e-09 1.275717e-08
- 3 Ameisenplage 5 ... 2.013352e-09 1.356500e-08
- 4 Ameisenplage 6 ... 2.691331e-09 1.519888e-08
- 5 Ameisenplage 3 ... 8.629463e-10 1.064780e-08
+ $ df = kcon.collocationScoreQuery("Grund", "triftiger")
```
"""
return KorAPClient.collocationScoreQuery(self, *args, **kwargs)