commit | 6fc4b2a87fb5526a167489179f28eee17277716f | [log] [tgz] |
---|---|---|
author | Marc Kupietz <kupietz@ids-mannheim.de> | Sat Jun 20 17:31:24 2020 +0200 |
committer | Marc Kupietz <kupietz@ids-mannheim.de> | Sat Jun 20 17:55:01 2020 +0200 |
tree | b09e333b63f89a163fd6b80e7bab8c11482e7bf3 | |
parent | f78db630c301a3a031e4462ea2bce1ba1eac0180 [diff] |
CI tests: run all tests from yaml directly Change-Id: If4ed8bc03f43f833cff14311b4dbc5a7f11de439
Python client package to access the web service API of the KorAP Corpus Analysis Platform developed at IDS Mannheim. Currently, this is no native Python package. Internally, it uses KorAP's client package for R via rpy2. Please note that with a native implementation the API might change.
#### Debian / Ubuntu sudo apt install r-base r-base-dev libcurl4-gnutls-dev libssl-dev libxml2-dev libsodium-dev python3-pip python3-rpy2 python3-pandas Rscript -e "install.packages('RKorAPClient')" #### Fedora / CentOS / RHEL sudo yum install r-base R-devel libcurl-devel openssl-devel libxml2-devel libsodium-devel python3-pandas Rscript -e "install.packages('RKorAPClient')"
python3 -m pip install git+https://github.com/KorAP/PythonKorAPClient
Currently, there is no dedicated documentation for the Python variant of the library. Please refer to the Refernce Manual of RKorAPClient for now. For translating the R syntax to Python and vice versa, pleas refer to the rpy2 Documentation.
from KorAPClient import KorAPClient import plotly.express as px QUERY = "Hello World" YEARS = range(2010, 2019) COUNTRIES = ["DE", "CH"] kcon = KorAPClient.KorAPConnection(verbose=True) vcs = ["textType=/Zeit.*/ & pubPlaceKey=" + c + " & pubDate in " + str(y) for c in COUNTRIES for y in YEARS] df = KorAPClient.ipm(KorAPClient.frequencyQuery(kcon, QUERY, vcs)) df['Year'] = [y for c in COUNTRIES for y in YEARS] df['Country'] = [c for c in COUNTRIES for y in YEARS] fig = px.line(df, title=QUERY, x="Year", y="ipm", color="Country", error_y="conf.high", error_y_minus="conf.low") fig.show()
By using the KorAPClient you agree to the respective terms of use of the accessed KorAP API services which will be printed upon opening a connection.
Author: Marc Kupietz
Copyright (c) 2020, Leibniz Institute for the German Language, Mannheim, Germany
This package is developed as part of the KorAP Corpus Analysis Platform at the Leibniz Institute for German Language (IDS).
It is published under the BSD-2 License.
Contributions are very welcome!
Your contributions should ideally be committed via our Gerrit server to facilitate reviewing (see Gerrit Code Review - A Quick Introduction if you are not familiar with Gerrit). However, we are also happy to accept comments and pull requests via GitHub.
Please note that unless you explicitly state otherwise any contribution intentionally submitted for inclusion into this software shall – as this software itself – be under the BSD-2 License.
Kupietz, Marc / Margaretha, Eliza / Diewald, Nils / Lüngen, Harald / Fankhauser, Peter (2019): What’s New in EuReCo? Interoperability, Comparable Corpora, Licensing. In: Bański, Piotr/Barbaresi, Adrien/Biber, Hanno/Breiteneder, Evelyn/Clematide, Simon/Kupietz, Marc/Lüngen, Harald/Iliadi, Caroline (eds.): Proceedings of the International Corpus Linguistics Conference 2019 Workshop "Challenges in the Management of Large Corpora (CMLC-7)", 22nd of July Mannheim: Leibniz-Institut für Deutsche Sprache, 33-39.
Kupietz, Marc / Diewald, Nils / Margaretha, Eliza (forthcoming): RKorAPClient: An R package for accessing the German Reference Corpus DeReKo via KorAP. In: Proceedings of the Twelfth International Conference on Language Resources and Evaluation (LREC 2020). Marseille/Paris: European Language Resources Association (ELRA).