![]() ![]() If no arguments are provided, it will start in interactive mode, in which you will be prompted to provide the requiredīabelNet indices path: /home/user/BabelNet-5.2 Port for documentation (, -1 to ignore): 8080 RPC mode (/ipc/all): all Port for TCP mode (): IPC directory: your_ipc_dir Starting server. To start the server, you can use the command babelnet-rpc start. or alternatively to the port defined by the arguments of the start command. Once the server is started, the documentation of the Python API will be available at With the following command: conda install pywin32 = 227 Documentation The additional dependencies required by the controller can be installed with the command: pip install babelnet įor Windows users: if you are working in an Anaconda environment, you need to install pywin32 using anaconda To simplify the management of the RPC server, you can use the babelnet-rpc command. Pull the new docker from the hub and start a new server with the updated image. Note: when you update the API to a newer version, you need to either restart the server using the controller or The controller is described in the following section for details on how to directly use theĭocker image, please follow the documentation on the Docker Hub page. In any case you need Docker to be installed in your system. To start the server, you can either use the RPC server controller or manually start the Docker. Python 3.8, and the same (or older) version of cloudpickle, i.e. Important: to use lambdas in RPC mode, the client code must be run using the same Python version of the # IPC URL example RPC_URL : "ipc:///home/user/your_ipc_dir/socket" If the RPC server has the optional IPC protocol enabled, you can use it with the following configuration line. You can specify the URL where the server is listening with theįollowing configuration line. The default protocol used by the RPC server is TCP. To configure the APIs in RPC mode, you just need to add one of these lines to your babelnet_conf.yml, depending on In the RPC mode, the Remote Procedure Call paradigm is applied in calling this Docker containerĪs a remote service, effectively decoupling PyLucene and BabelNet. Because of this, we moved this PyLucene build and install process toĪ simple Docker image. Since it has many dependencies that need compiling. The installation process of Lucene can be tricky This can be considered a full mode, because it has no usage limit and faster responses.īabelNet Python API requires PyLucene, which has a dependency on Lucene itself. To use the RPC mode you need a local copy of the BabelNet indices. If you want to use a different REST endpoint, add the following line to babelnet_conf.yml: # BabelNet 5.2 REST endpoint RESTFUL_URL : '' RPC Mode This will automatically be used to authenticate you on the official BabelNet REST service. the iterator, offset_iterator, lexicon_iteratorĪssuming you have received by e-mail the key 3x54mp13-8au0-o97q-9vzz-3vakcpec8w4p, add the following line However, the drawback is that the iterators are unavailable, i.e. This is the simplest version to use, since it requires only a valid API key. The RPC server controller (see below) requires additional dependencies that can be installed with the following pip command: pip install babelnet įurther details on how to use these modes are provided in the following sections. To use this mode you need theīabelNet indices and Docker installed in your system. Workloads than the online mode since it is faster and doesn't have usage limits. RPC Mode: reads data directly from a local copy of the BabelNet indices, making it more suitable for heavy ![]() To use this mode you need an internet connection Online Mode: uses the online REST service to retrieve the data. The content of the babelnet_conf.yml should vary according to the usage mode of choice: ConfigurationĪfter the installation, the first step to take when you want to use BabelNet in another project (or in the REPL) is toĬreate a file called babelnet_conf.yml in the current working directory.Īlternatively, the path of the configuration file can be specified using the BABELNET_CONF environment variable. Version compatibilityīabelNet Python API can be used with BabeNet 4.0 and above. Website ( ) for news, updates and papers. Information, please refer to the documentation below on how to use the software, and our This package consists of a Python API to work with BabelNet, a very large multilingual semantic network. ![]()
0 Comments
Leave a Reply. |