MCPcopy Index your code
hub / github.com/MaartenGr/BERTopic / __str__

Method __str__

bertopic/_bertopic.py:4870–4884  ·  view source on GitHub ↗

Get a string representation of the current object. Returns: str: Human readable representation of the most important model parameters. The parameters that represent models are ignored due to their length.

(self)

Source from the content-addressed store, hash-verified

4868 return parameters
4869
4870 def __str__(self):
4871 """Get a string representation of the current object.
4872
4873 Returns:
4874 str: Human readable representation of the most important model parameters.
4875 The parameters that represent models are ignored due to their length.
4876 """
4877 parameters = ""
4878 for parameter, value in self.get_params().items():
4879 value = str(value)
4880 if "(" in value and value[0] != "(":
4881 value = value.split("(")[0] + "(...)"
4882 parameters += f"{parameter}={value}, "
4883
4884 return f"BERTopic({parameters[:-2]})"
4885
4886
4887class TopicMapper:

Callers

nothing calls this directly

Calls 1

get_paramsMethod · 0.95

Tested by

no test coverage detected