
Situation
def __make_corpus_passages(self, row):
# Corpus to passages
passage = Passage(
id=row['_id'],
content=row['text'],
filepath=self.file_path,
metadata_etc={'title': row['title']}
)
return passage
The method above was declared in the parent class, BaseBeirEvaluator. When I applied it to BeirScifactEvaluator, its child class, in the apply method that creates the ground-truth passage in the code below,
gt_passages = gt_passages.apply(self.__make_corpus_passages, axis=1).tolist()
it said that this method did not exist.

Solution
When a method or property name begins with an underscore _, it is designated as a private member. Therefore, these methods or properties cannot be accessed from outside. They can only be used within the same scope.
Therefore, it said that the __make_corpus_passages method could not be found because it was private~
def make_corpus_passages(self, row):
# Corpus to passages
passage = Passage(
id=row['_id'],
content=row['text'],
filepath=self.file_path,
metadata_etc={'title': row['title']}
)
return passage
By making a method or property private, it prevents the values inside the function from being altered externally.
Originally, I had intended to make make_corpus_passage private to make it impossible to alter.