• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PyThaiNLP / pythainlp / 11626163864

01 Nov 2024 07:49AM UTC coverage: 14.17% (+14.2%) from 0.0%
11626163864

Pull #952

github

web-flow
Merge 8f2551bc9 into 89ea62ebc
Pull Request #952: Specify a limited test suite

44 of 80 new or added lines in 48 files covered. (55.0%)

1048 of 7396 relevant lines covered (14.17%)

0.14 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/pythainlp/el/_multiel.py
1
# -*- coding: utf-8 -*-
2
# SPDX-FileCopyrightText: 2016-2024 PyThaiNLP Project
3
# SPDX-License-Identifier: Apache-2.0
4

5

6
class MultiEL:
×
7
    def __init__(self, model_name="bela", device="cuda"):
×
8
        self.model_name = model_name
×
9
        self.device = device
×
10
        self.load_model()
×
11

12
    def load_model(self):
×
13
        try:
×
14
            from multiel import BELA
×
NEW
15
        except ImportError as exc:
×
16
            raise ImportError(
×
17
                "Can't import multiel package, you can install by pip install multiel."
18
            ) from exc
19
        self._bela_run = BELA(device=self.device)
×
20

21
    def process_batch(self, list_text):
×
22
        if isinstance(list_text, str):
×
23
            list_text = [list_text]
×
24
        return self._bela_run.process_batch(list_text)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc