orkgnlp.common.service.base.ORKGNLPBaseService

class ORKGNLPBaseService(service, *, force_download=False, batch_size=16, _unittest=False)[source]

Bases: object

Base class for shared config parameters and functionalities. All ORKG-NLP services must inherit from this class.

This class follows the singleton pattern, i.e. only one instance can be obtained from it or its subclasses.

Parameters
  • service (str) – Service name.

  • force_download (bool) – Indicates whether the required files are to be downloaded again. Defaults to False.

  • batch_size (int) – Size of the batches used during model prediction. This argument is used by services that applies batch evaluation. Defaults to 16.

Methods

release_memory

Releases the memory of all available executors.

release_memory()[source]

Releases the memory of all available executors.