MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / text_classification

Function text_classification

bmtools/tools/hugging_tools/api.py:146–148  ·  view source on GitHub ↗
(model_id: str, text: str)

Source from the content-addressed store, hash-verified

144 return str(inference({"source_sentence": text, "sentences" : [(context if context else "")]}))
145 @task
146 def text_classification(model_id: str, text: str) -> str:
147 inference = InferenceApi(repo_id=model_id, token=CONFIG["huggingface"]["token"])
148 return str(inference(text))
149 @task
150 def token_classification(model_id: str, text: str) -> str:
151 inference = InferenceApi(repo_id=model_id, token=CONFIG["huggingface"]["token"])

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected