def save(self, writer=None):
        """
        If self.path is defined, it tries to save the corpus at the given path.
        """

        if self.path is None:
            raise ValueError('No path given to save the data set.')

        self.save_at(self.path, writer)
If self.path is defined, it tries to save the corpus at the given path.