How to use the asreview.io.paper_record.PaperRecord function in asreview

To help you get started, we’ve selected a few asreview examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github msdslab / automated-systematic-review / asreview / data.py View on Github external
-------
        PaperRecord:
            The corresponding record if i was an integer, or a list of records
            if i was an iterable.
        """
        if not is_iterable(i):
            index_list = [i]
        else:
            index_list = i

        if not by_index:
            records = [PaperRecord(**self.df.loc[j, :], record_id=j,
                                   column_spec=self.column_spec)
                       for j in index_list]
        else:
            records = [PaperRecord(**self.df.iloc[j],
                                   column_spec=self.column_spec,
                                   record_id=self.df.index.values[j])
                       for j in index_list]

        if is_iterable(i):
            return records
        return records[0]
github msdslab / automated-systematic-review / asreview / data.py View on Github external
If True, take the i-th value as used internally by the review.
            If False, take the record with record_id==i.

        Returns
        -------
        PaperRecord:
            The corresponding record if i was an integer, or a list of records
            if i was an iterable.
        """
        if not is_iterable(i):
            index_list = [i]
        else:
            index_list = i

        if not by_index:
            records = [PaperRecord(**self.df.loc[j, :], record_id=j,
                                   column_spec=self.column_spec)
                       for j in index_list]
        else:
            records = [PaperRecord(**self.df.iloc[j],
                                   column_spec=self.column_spec,
                                   record_id=self.df.index.values[j])
                       for j in index_list]

        if is_iterable(i):
            return records
        return records[0]