| Total Complexity | 3 |
| Total Lines | 9 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | """HTTP/REST client backend that makes calls to a web service |
||
| 10 | class HTTPBackend(backend.AnnifBackend): |
||
|
1 ignored issue
–
show
|
|||
| 11 | name = "http" |
||
| 12 | |||
| 13 | def _analyze(self, text, params): |
||
| 14 | data = {'text': text, 'project': params['project']} |
||
| 15 | req = requests.post(params['endpoint'], data=data) |
||
| 16 | return [AnalysisHit(h['uri'], h['label'], h['score']) |
||
| 17 | for h in req.json() |
||
| 18 | if h['score'] > 0.0] |
||
| 19 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.