def METHOD_NAME(self):
    def count_string(words):
        if not isinstance(words, str):
            return np.nan
        words = self.process_text(words)
        return len(re.findall(self.pattern, words))
    return np.vectorize(count_string, otypes=[float])