__init__.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Copyright The Lightning team.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. from torchmetrics.text.bleu import BLEUScore
  15. from torchmetrics.text.cer import CharErrorRate
  16. from torchmetrics.text.chrf import CHRFScore
  17. from torchmetrics.text.edit import EditDistance
  18. from torchmetrics.text.eed import ExtendedEditDistance
  19. from torchmetrics.text.mer import MatchErrorRate
  20. from torchmetrics.text.perplexity import Perplexity
  21. from torchmetrics.text.rouge import ROUGEScore
  22. from torchmetrics.text.sacre_bleu import SacreBLEUScore
  23. from torchmetrics.text.squad import SQuAD
  24. from torchmetrics.text.ter import TranslationEditRate
  25. from torchmetrics.text.wer import WordErrorRate
  26. from torchmetrics.text.wil import WordInfoLost
  27. from torchmetrics.text.wip import WordInfoPreserved
  28. from torchmetrics.utilities.imports import _TRANSFORMERS_GREATER_EQUAL_4_4
  29. __all__ = [
  30. "BLEUScore",
  31. "CHRFScore",
  32. "CharErrorRate",
  33. "EditDistance",
  34. "ExtendedEditDistance",
  35. "MatchErrorRate",
  36. "Perplexity",
  37. "ROUGEScore",
  38. "SQuAD",
  39. "SacreBLEUScore",
  40. "TranslationEditRate",
  41. "WordErrorRate",
  42. "WordInfoLost",
  43. "WordInfoPreserved",
  44. ]
  45. if _TRANSFORMERS_GREATER_EQUAL_4_4:
  46. from torchmetrics.text.bert import BERTScore
  47. from torchmetrics.text.infolm import InfoLM
  48. __all__ += ["BERTScore", "InfoLM"]