Giter VIP home page Giter VIP logo

summertime's Introduction

SummerTime - Text Summarization Toolkit for Non-experts

CI License Open In Colab

A library to help users choose appropriate summarization tools based on their specific tasks or needs. Includes models, evaluation metrics, and datasets.

The library architecture is as follows:

NOTE: SummerTime is in active development, any helpful comments are highly encouraged, please open an issue or reach out to any of the team members.

Installation and setup

Install from PyPI (recommended)

# install extra dependencies first
pip install pyrouge@git+https://github.com/bheinzerling/pyrouge.git
pip install en_core_web_sm@https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.0.0/en_core_web_sm-3.0.0-py3-none-any.whl

# install summertime from PyPI
pip install summertime

Local pip installation

Alternatively, to enjoy the most recent features, you can install from the source:

git clone [email protected]:Yale-LILY/SummerTime
pip install -e .
Setup ROUGE (when using evaluation)
export ROUGE_HOME=/usr/local/lib/python3.7/dist-packages/summ_eval/ROUGE-1.5.5/

Quick Start

Imports model, initializes default model, and summarizes sample documents.

from summertime import model

sample_model = model.summarizer()
documents = [
    """ PG&E stated it scheduled the blackouts in response to forecasts for high winds amid dry conditions. 
    The aim is to reduce the risk of wildfires. Nearly 800 thousand customers were scheduled to be affected 
    by the shutoffs which were expected to last through at least midday tomorrow."""
]
sample_model.summarize(documents)

# ["California's largest electricity provider has turned off power to hundreds of thousands of customers."]

Also, please run our colab notebook for a more hands-on demo and more examples.

Open In Colab

Models

Supported Models

SummerTime supports different models (e.g., TextRank, BART, Longformer) as well as model wrappers for more complex summarization tasks (e.g., JointModel for multi-doc summarzation, BM25 retrieval for query-based summarization). Several multilingual models are also supported (mT5 and mBART).

Models Single-doc Multi-doc Dialogue-based Query-based Multilingual
BartModel ✔️
BM25SummModel ✔️
HMNetModel ✔️
LexRankModel ✔️
LongformerModel ✔️
MBartModel ✔️ 50 languages (full list here)
MT5Model ✔️ 101 languages (full list here)
TranslationPipelineModel ✔️ ~70 languages
MultiDocJointModel ✔️
MultiDocSeparateModel ✔️
PegasusModel ✔️
TextRankModel ✔️
TFIDFSummModel ✔️

To see all supported models, run:

from summertime.model import SUPPORTED_SUMM_MODELS
print(SUPPORTED_SUMM_MODELS)

Import and initialization:

from summertime import model

# To use a default model
default_model = model.summarizer()    

# Or a specific model
bart_model = model.BartModel()
pegasus_model = model.PegasusModel()
lexrank_model = model.LexRankModel()
textrank_model = model.TextRankModel()

Users can easily access documentation to assist with model selection

default_model.show_capability()
pegasus_model.show_capability()
textrank_model.show_capability()

To use a model for summarization, simply run:

documents = [
    """ PG&E stated it scheduled the blackouts in response to forecasts for high winds amid dry conditions. 
    The aim is to reduce the risk of wildfires. Nearly 800 thousand customers were scheduled to be affected 
    by the shutoffs which were expected to last through at least midday tomorrow."""
]

default_model.summarize(documents)
# or 
pegasus_model.summarize(documents)

All models can be initialized with the following optional options:

def __init__(self,
         trained_domain: str=None,
         max_input_length: int=None,
         max_output_length: int=None,
         ):

All models will implement the following methods:

def summarize(self,
  corpus: Union[List[str], List[List[str]]],
  queries: List[str]=None) -> List[str]:

def show_capability(cls) -> None:

Datasets

Datasets supported

SummerTime supports different summarization datasets across different domains (e.g., CNNDM dataset - news article corpus, Samsum - dialogue corpus, QM-Sum - query-based dialogue corpus, MultiNews - multi-document corpus, ML-sum - multi-lingual corpus, PubMedQa - Medical domain, Arxiv - Science papers domain, among others.

Dataset Domain # Examples Src. length Tgt. length Query Multi-doc Dialogue Multi-lingual
ArXiv Scientific articles 215k 4.9k 220
CNN/DM(3.0.0) News 300k 781 56
MlsumDataset Multi-lingual News 1.5M+ 632 34 ✔️ German, Spanish, French, Russian, Turkish
Multi-News News 56k 2.1k 263.8 ✔️
SAMSum Open-domain 16k 94 20 ✔️
Pubmedqa Medical 272k 244 32 ✔️
QMSum Meetings 1k 9.0k 69.6 ✔️ ✔️
ScisummNet Scientific articles 1k 4.7k 150
SummScreen TV shows 26.9k 6.6k 337.4 ✔️
XSum News 226k 431 23.3
XLSum News 1.35m ??? ??? 45 languages (see documentation)
MassiveSumm News 12m+ ??? ??? 78 languages (see Multilingual Summarization section of README for details)

To see all supported datasets, run:

from summertime import dataset

print(dataset.list_all_dataset())

Dataset Initialization

from summertime import dataset

cnn_dataset = dataset.CnndmDataset()
# or 
xsum_dataset = dataset.XsumDataset()
# ..etc
Dataset Object

All datasets are implementations of the SummDataset class. Their data splits can be accessed as follows:

dataset = dataset.CnndmDataset()

train_data = dataset.train_set  
dev_data = dataset.dev_set  
test_data = dataset.test_set        

To see the details of the datasets, run:

dataset = dataset.CnndmDataset()

dataset.show_description()
Data instance

The data in all datasets is contained in a SummInstance class object, which has the following properties:

data_instance.source = source    # either `List[str]` or `str`, depending on the dataset itself, string joining may needed to fit into specific models.
data_instance.summary = summary  # a string summary that serves as ground truth
data_instance.query = query      # Optional, applies when a string query is present

print(data_instance)             # to print the data instance in its entirety

Loading and using data instances

Data is loaded using a generator to save on space and time

To get a single instance

data_instance = next(cnn_dataset.train_set)
print(data_instance)

To get a slice of the dataset

import itertools

# Get a slice from the train set generator - first 5 instances
train_set = itertools.islice(cnn_dataset.train_set, 5)

corpus = [instance.source for instance in train_set]
print(corpus)

Loading a custom dataset

You can use custom data using the CustomDataset class that loads the data in the SummerTime dataset Class

from summertime.dataset import CustomDataset

''' The train_set, test_set and validation_set have the following format: 
        List[Dict], list of dictionaries that contain a data instance.
            The dictionary is in the form:
                {"source": "source_data", "summary": "summary_data", "query":"query_data"}
                    * source_data is either of type List[str] or str
                    * summary_data is of type str
                    * query_data is of type str
        The list of dictionaries looks as follows:
            [dictionary_instance_1, dictionary_instance_2, ...]
'''

# Create sample data
train_set = [
    {
        "source": "source1",
        "summary": "summary1",
        "query": "query1",      # only included, if query is present
    }
]
validation_set = [
    {
        "source": "source2",
        "summary": "summary2",
        "query": "query2",      
    }
]
test_set = [
    {
        "source": "source3",
        "summary": "summary3",
        "query": "query3",     
    }
]

# Depending on the dataset properties, you can specify the type of dataset
#   i.e multi_doc, query_based, dialogue_based. If not specified, they default to false
custom_dataset = CustomDataset(
                    train_set=train_set,
                    validation_set=validation_set,
                    test_set=test_set,
                    query_based=True,
                    multi_doc=True
                    dialogue_based=False)

Using the datasets with the models - Examples

import itertools
from summertime import dataset, model

cnn_dataset = dataset.CnndmDataset()


# Get a slice of the train set - first 5 instances
train_set = itertools.islice(cnn_dataset.train_set, 5)

corpus = [instance.source for instance in train_set]



# Example 1 - traditional non-neural model
# LexRank model
lexrank = model.LexRankModel(corpus)
print(lexrank.show_capability())

lexrank_summary = lexrank.summarize(corpus)
print(lexrank_summary)


# Example 2 - A spaCy pipeline for TextRank (another non-neueral extractive summarization model)
# TextRank model
textrank = model.TextRankModel()
print(textrank.show_capability())

textrank_summary = textrank.summarize(corpus)
print(textrank_summary)


# Example 3 - A neural model to handle large texts
# LongFormer Model
longformer = model.LongFormerModel()
longformer.show_capability()

longformer_summary = longformer.summarize(corpus)
print(longformer_summary)

Multilingual summarization

The summarize() method of multilingual models automatically checks for input document language.

Single-doc multilingual models can be initialized and used in the same way as monolingual models. They return an error if a language not supported by the model is input.

mbart_model = st_model.MBartModel()
mt5_model = st_model.MT5Model()

# load Spanish portion of MLSum dataset
mlsum = datasets.MlsumDataset(["es"])

corpus = itertools.islice(mlsum.train_set, 5)
corpus = [instance.source for instance in train_set]

# mt5 model will automatically detect Spanish as the language and indicate that this is supported!
mt5_model.summarize(corpus)

The following languages are currently supported in our implementation of the MassiveSumm dataset: Afrikaans, Amharic, Arabic, Assamese, Aymara, Azerbaijani, Bambara, Bengali, Tibetan, Bosnian, Bulgarian, Catalan, Czech, Welsh, Danish, German, Greek, English, Esperanto, Persian, Filipino, French, Fulah, Irish, Gujarati, Haitian, Hausa, Hebrew, Hindi, Croatian, Hungarian, Armenian,Igbo, Indonesian, Icelandic, Italian, Japanese, Kannada, Georgian, Khmer, Kinyarwanda, Kyrgyz, Korean, Kurdish, Lao, Latvian, Lingala, Lithuanian, Malayalam, Marathi, Macedonian, Malagasy, Mongolian, Burmese, South Ndebele, Nepali, Dutch, Oriya, Oromo, Punjabi, Polish, Portuguese, Dari, Pashto, Romanian, Rundi, Russian, Sinhala, Slovak, Slovenian, Shona, Somali, Spanish, Albanian, Serbian, Swahili, Swedish, Tamil, Telugu, Tetum, Tajik, Thai, Tigrinya, Turkish, Ukrainian, Urdu, Uzbek, Vietnamese, Xhosa, Yoruba, Yue Chinese, Chinese, Bislama, and Gaelic.

Evaluation

SummerTime supports different evaluation metrics including: BertScore, Bleu, Meteor, Rouge, RougeWe

To print all supported metrics:

from summertime.evaluation import SUPPORTED_EVALUATION_METRICS

print(SUPPORTED_EVALUATION_METRICS)

Import and initialization:

import summertime.evaluation as st_eval

bert_eval = st_eval.bertscore()
bleu_eval = st_eval.bleu_eval()
meteor_eval = st_eval.bleu_eval()
rouge_eval = st_eval.rouge()
rougewe_eval = st_eval.rougewe()

Evaluation Class

All evaluation metrics can be initialized with the following optional arguments:

def __init__(self, metric_name):

All evaluation metric objects implement the following methods:

def evaluate(self, model, data):

def get_dict(self, keys):

Using evaluation metrics

Get sample summary data

from summertime.evaluation.base_metric import SummMetric
from summertime.evaluation import Rouge, RougeWe, BertScore

import itertools

# Evaluates model on subset of cnn_dailymail
# Get a slice of the train set - first 5 instances
train_set = itertools.islice(cnn_dataset.train_set, 5)

corpus = [instance for instance in train_set]
print(corpus)

articles = [instance.source for instance in corpus]

summaries = sample_model.summarize(articles)
targets = [instance.summary for instance in corpus]

Evaluate the data on different metrics

from summertime.evaluation import  BertScore, Rouge, RougeWe,

# Calculate BertScore
bert_metric = BertScore()
bert_score = bert_metric.evaluate(summaries, targets)
print(bert_score)

# Calculate Rouge
rouge_metric = Rouge()
rouge_score = rouge_metric.evaluate(summaries, targets)
print(rouge_score)

# Calculate RougeWe
rougewe_metric = RougeWe()
rougwe_score = rougewe_metric.evaluate(summaries, targets)
print(rougewe_score)

Using automatic pipeline assembly

Given a SummerTime dataset, you may use the pipelines.assemble_model_pipeline function to retrieve a list of initialized SummerTime models that are compatible with the dataset provided.

from summertime.pipeline import assemble_model_pipeline
from summertime.dataset import CnndmDataset, QMsumDataset

single_doc_models = assemble_model_pipeline(CnndmDataset)
# [
#   (<model.single_doc.bart_model.BartModel object at 0x7fcd43aa12e0>, 'BART'),
#   (<model.single_doc.lexrank_model.LexRankModel object at 0x7fcd43aa1460>, 'LexRank'),
#   (<model.single_doc.longformer_model.LongformerModel object at 0x7fcd43b17670>, 'Longformer'),
#   (<model.single_doc.pegasus_model.PegasusModel object at 0x7fccb84f2910>, 'Pegasus'),
#   (<model.single_doc.textrank_model.TextRankModel object at 0x7fccb84f2880>, 'TextRank')
# ]

query_based_multi_doc_models = assemble_model_pipeline(QMsumDataset)
# [
#   (<model.query_based.tf_idf_model.TFIDFSummModel object at 0x7fc9c9c81e20>, 'TF-IDF (HMNET)'),
#   (<model.query_based.bm25_model.BM25SummModel object at 0x7fc8b4fa8c10>, 'BM25 (HMNET)')
# ]

=======

Visualizing performance of different models on your dataset

Given a SummerTime dataset, you may use the pipelines.assemble_model_pipeline function to retrieve a list of initialized SummerTime models that are compatible with the dataset provided.

# Get test data
import itertools
from summertime.dataset import XsumDataset

# Get a slice of the train set - first 5 instances
sample_dataset = XsumDataset()
sample_data = itertools.islice(sample_dataset.train_set, 100)
generator1 = iter(sample_data)
generator2 = iter(sample_data)

bart_model = BartModel()
pegasus_model = PegasusModel()
models = [bart_model, pegasus_model]
metrics = [metric() for metric in SUPPORTED_EVALUATION_METRICS]

Create a radar plot

from summertime.evaluation.model_selector import ModelSelector

selector = ModelSelector(models, generator1, metrics)
table = selector.run()
print(table)
visualization = selector.visualize(table)

from summertime.evaluation.model_selector import ModelSelector

new_selector = ModelSelector(models, generator2, metrics)
smart_table = new_selector.run_halving(min_instances=2, factor=2)
print(smart_table)
visualization_smart = selector.visualize(smart_table)

Create a scatter plot

from summertime.evaluation.model_selector import ModelSelector
from summertime.evaluation.error_viz import scatter

keys = ("bert_score_f1", "bleu", "rouge_1_f_score", "rouge_2_f_score", "rouge_l_f_score", "rouge_we_3_f", "meteor")

scatter(models, sample_data, metrics[1:3], keys=keys[1:3], max_instances=5)

To contribute

Pull requests

Create a pull request and name it [your_gh_username]/[your_branch_name]. If needed, resolve your own branch's merge conflicts with main. Do not push directly to main.

Code formatting

If you haven't already, install black and flake8:

pip install black
pip install flake8

Before pushing commits or merging branches, run the following commands from the project root. Note that black will write to files, and that you should add and commit changes made by black before pushing:

black .
flake8 .

Or if you would like to lint specific files:

black path/to/specific/file.py
flake8 path/to/specific/file.py

Ensure that black does not reformat any files and that flake8 does not print any errors. If you would like to override or ignore any of the preferences or practices enforced by black or flake8, please leave a comment in your PR for any lines of code that generate warning or error logs. Do not directly edit config files such as setup.cfg.

See the black docs and flake8 docs for documentation on installation, ignoring files/lines, and advanced usage. In addition, the following may be useful:

  • black [file.py] --diff to preview changes as diffs instead of directly making changes
  • black [file.py] --check to preview changes with status codes instead of directly making changes
  • git diff -u | flake8 --diff to only run flake8 on working branch changes

Note that our CI test suite will include invoking black --check . and flake8 --count . on all non-unittest and non-setup Python files, and zero error-level output is required for all tests to pass.

Tests

Our continuous integration system is provided through Github actions. When any pull request is created or updated or whenever main is updated, the repository's unit tests will be run as build jobs on tangra for that pull request. Build jobs will either pass or fail within a few minutes, and build statuses and logs are visible under Actions. Please ensure that the most recent commit in pull requests passes all checks (i.e. all steps in all jobs run to completion) before merging, or request a review. To skip a build on any particular commit, append [skip ci] to the commit message. Note that PRs with the substring /no-ci/ anywhere in the branch name will not be included in CI.

Citation

This repository is built by the LILY Lab at Yale University, led by Prof. Dragomir Radev. The main contributors are Ansong Ni, Zhangir Azerbayev, Troy Feng, Murori Mutuma, Hailey Schoelkopf, and Yusen Zhang (Penn State).

If you use SummerTime in your work, consider citing:

@article{ni2021summertime,
     title={SummerTime: Text Summarization Toolkit for Non-experts}, 
     author={Ansong Ni and Zhangir Azerbayev and Mutethia Mutuma and Troy Feng and Yusen Zhang and Tao Yu and Ahmed Hassan Awadallah and Dragomir Radev},
     journal={arXiv preprint arXiv:2108.12738},
     year={2021}
}

For comments and question, please open an issue.

summertime's People

Contributors

6wj avatar arjunvnair avatar chatc avatar haileyschoelkopf avatar murorim avatar niansong1996 avatar taoyds avatar troyfeng116 avatar zhangir-azerbayev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

summertime's Issues

mpi4py installation error

the error says

   _configtest.c:2:10: fatal error: mpi.h: No such file or directory
        2 | #include <mpi.h>
          |          ^~~~~~~
    compilation terminated.
    failure.
    removing: _configtest.c _configtest.o
    error: Cannot compile MPI programs. Check your configuration!!!

Add Multilingual Datasets

We currently have only 1 multilingual dataset with 5 languages, but have multilingual models that theoretically support many more than that. I would like to implement:

So that we have a much greater spread of multilingual data to test on.

Inconsistent printing/logging

The printing and logging are slightly out-of-hand. We've got messages printed out everywhere, some from the models that we import and some from random places for debugging purposes.

We should regulate this more with the python logging package and add a hierarchy of logging levels (i.e., debug, info, warning, error, etc)

ModuleNotFoundError: No module named 'summertime'

Hello! I'm trying to install summertime, but I cannot import it after installation.

How to reproduce

Run on colab:

%pip install pyrouge@git+https://github.com/bheinzerling/pyrouge.git
%pip install en_core_web_sm@https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.0.0/en_core_web_sm-3.0.0-py3-none-any.whl
%pip install summertime
from summertime import model
> ModuleNotFoundError: No module named 'summertime'

Edit: even after updating pip, the problem is still there.

The package is correctly installed:

%pip freeze | grep summertime
> summertime==1.2.1

I've also tried to install on Python 3.9, and the problem persists.

API for user-created datasets

Have APIs for users to create datasets from their own data and demo for doing this in README and the colab example.

Spacy Version Conflict

SummTime uses Spacy 3 while HMNet uses Spacy 2. However, there are several differences between these two versions which are similar to Python 2 and Python 3. Hence, we need to either adapt one of two versions or find a way to use both of them.

Input for Single-Doc Summerization

Hello, Is it possible to provide a list of (already split) sentences as the source input to the summarizer, as opposed to a single source document? The goal is to treat each list of sentences as one long sequence during extractive summarization.

Integration test

We need to have some kind of integration test to test the combination of different models, datasets and evaluation metrics

Can i specify dataset path in datasetclass?

import dataset
arxdt = dataset.ArxivDataset()

In this, this default saved path is /home/$username/.cache/huggingface/datasets/summertime_arxiv.
Can I specify a certain path when downloading and loading the dataset?

Automatic pipeline assembly

Given a dataset, automatically figure out the set of applicable models.

An example:
Input: QMSum dataset (query-based, dialogue summarization)
Output: all pipeline models that can deal with this setting (e.g., BM25 + HMNet; TFIDF + HMNet; BM25 + Flatten-dialogue + BART, etc)

Documentation for HMNetModel

HI :)

I would like know how to use HMNetModel for dialogues.

I have code:

from model import HMNetModel

hmn = HMNetModel()
print(hmn.summarize(dial))

How should dial looks like? Can I get dial from CNN/DM(3.0.0) dataset?

Thanks in advance for your help :)

self.model needs to be moved to GPU in BartModel

In SummerTime_midway_showcase_08_28.ipynb, when I defined an object of BartModel on GPU and ran the inference as follows:

bart_model = st_model.BartModel(device='cuda')
documents = [
    """xxx"""
]
bart_model.summarize(documents)

I got the following error:

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-4-5f5c5eef9ea1> in <module>()
      3 ]
      4 
----> 5 sample_model.summarize(documents)

8 frames
/content/SummerTime/summertime/model/single_doc/bart_model.py in summarize(self, corpus, queries)
     27             corpus, truncation=True, padding="longest", return_tensors="pt"
     28         ).to(self.device)
---> 29         encoded_summaries = self.model.generate(**batch)
     30         summaries = self.tokenizer.batch_decode(
     31             encoded_summaries, skip_special_tokens=True

/usr/local/lib/python3.7/dist-packages/torch/autograd/grad_mode.py in decorate_context(*args, **kwargs)
     25         def decorate_context(*args, **kwargs):
     26             with self.__class__():
---> 27                 return func(*args, **kwargs)
     28         return cast(F, decorate_context)
     29 

/usr/local/lib/python3.7/dist-packages/transformers/generation_utils.py in generate(self, input_ids, max_length, min_length, do_sample, early_stopping, num_beams, temperature, top_k, top_p, repetition_penalty, bad_words_ids, bos_token_id, pad_token_id, eos_token_id, length_penalty, no_repeat_ngram_size, encoder_no_repeat_ngram_size, num_return_sequences, max_time, decoder_start_token_id, use_cache, num_beam_groups, diversity_penalty, prefix_allowed_tokens_fn, output_attentions, output_hidden_states, output_scores, return_dict_in_generate, forced_bos_token_id, forced_eos_token_id, remove_invalid_values, **model_kwargs)
    925         if self.config.is_encoder_decoder:
    926             # add encoder_outputs to model_kwargs
--> 927             model_kwargs = self._prepare_encoder_decoder_kwargs_for_generation(input_ids, model_kwargs)
    928 
    929             # set input_ids as decoder_input_ids

/usr/local/lib/python3.7/dist-packages/transformers/generation_utils.py in _prepare_encoder_decoder_kwargs_for_generation(self, input_ids, model_kwargs)
    410                 argument: value for argument, value in model_kwargs.items() if not argument.startswith("decoder_")
    411             }
--> 412             model_kwargs["encoder_outputs"]: ModelOutput = encoder(input_ids, return_dict=True, **encoder_kwargs)
    413         return model_kwargs
    414 

/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
    887             result = self._slow_forward(*input, **kwargs)
    888         else:
--> 889             result = self.forward(*input, **kwargs)
    890         for hook in itertools.chain(
    891                 _global_forward_hooks.values(),

/usr/local/lib/python3.7/dist-packages/transformers/models/bart/modeling_bart.py in forward(self, input_ids, attention_mask, head_mask, inputs_embeds, output_attentions, output_hidden_states, return_dict)
    748 
    749         if inputs_embeds is None:
--> 750             inputs_embeds = self.embed_tokens(input_ids) * self.embed_scale
    751 
    752         embed_pos = self.embed_positions(input_shape)

/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
    887             result = self._slow_forward(*input, **kwargs)
    888         else:
--> 889             result = self.forward(*input, **kwargs)
    890         for hook in itertools.chain(
    891                 _global_forward_hooks.values(),

/usr/local/lib/python3.7/dist-packages/torch/nn/modules/sparse.py in forward(self, input)
    156         return F.embedding(
    157             input, self.weight, self.padding_idx, self.max_norm,
--> 158             self.norm_type, self.scale_grad_by_freq, self.sparse)
    159 
    160     def extra_repr(self) -> str:

/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py in embedding(input, weight, padding_idx, max_norm, norm_type, scale_grad_by_freq, sparse)
   1914         # remove once script supports set_grad_enabled
   1915         _no_grad_embedding_renorm_(weight, input, max_norm, norm_type)
-> 1916     return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
   1917 
   1918 

RuntimeError: Input, output and indices must be on the current device

Change the following line

self.model = BartForConditionalGeneration.from_pretrained(model_name)

to

self.model = BartForConditionalGeneration.from_pretrained(model_name).to(self.device)

would fix it.

Could you provide train code

I want to do BART finetuning on my dataset,
Could you provide a snippet of the train code?
And, I also want to do pre-training on another dataset. If there is, could you send me a link.

Error during installation - clang: error: the clang compiler does not support '-march=native'

Hi Folks, this looks like a REALLY useful toolkit. Kudos. I will most likely start on a text summarization interface for Apache Tika and SummerTime looks like it could be a great implementation.
I tried to install on macOS Catalina 10.15.7

% pip3 install pyrouge@git+https://github.com/bheinzerling/pyrouge.git
% pip3 install en_core_web_sm@https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.0.0/en_core_web_sm-3.0.0-py3-none-any.whl
% pip3 install summertime
...
Building wheels for collected packages: pyemd, wmd
  Building wheel for pyemd (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-install-rx5dmeye/pyemd_ad43b78cfae24d44a96e3465d0e1c40e/setup.py'"'"'; __file__='"'"'/private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-install-rx5dmeye/pyemd_ad43b78cfae24d44a96e3465d0e1c40e/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-wheel-kwtyvmij
       cwd: /private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-install-rx5dmeye/pyemd_ad43b78cfae24d44a96e3465d0e1c40e/
  Complete output (118 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.14.6-x86_64-3.8
  creating build/lib.macosx-10.14.6-x86_64-3.8/pyemd
  copying pyemd/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/pyemd
  copying pyemd/__about__.py -> build/lib.macosx-10.14.6-x86_64-3.8/pyemd
  running build_ext
  building 'pyemd.emd' extension
  creating build/temp.macosx-10.14.6-x86_64-3.8
  creating build/temp.macosx-10.14.6-x86_64-3.8/pyemd
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -I/Users/lmcgibbn/Library/Python/3.8/lib/python/site-packages/numpy/core/include -c pyemd/emd.cpp -o build/temp.macosx-10.14.6-x86_64-3.8/pyemd/emd.o
  In file included from pyemd/emd.cpp:23:
  In file included from /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:11:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/limits.h:57:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/limits.h:21:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/limits.h:63:
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
  #error Unsupported architecture
   ^
  In file included from pyemd/emd.cpp:23:
  In file included from /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:11:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/limits.h:57:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/limits.h:21:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/limits.h:64:
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/limits.h:8:2: error: architecture not supported
  #error architecture not supported
   ^
  In file included from pyemd/emd.cpp:23:
  In file included from /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdio.h:107:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:71:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_types.h:27:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:33:
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
  #error architecture not supported
   ^
  In file included from pyemd/emd.cpp:23:
  In file included from /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdio.h:107:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:71:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_types.h:27:
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t'
  typedef __int64_t       __darwin_blkcnt_t;      /* total blocks */
          ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:56:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
  typedef __int32_t       __darwin_blksize_t;     /* preferred block size */
          ^
  note: '__int128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:57:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
  typedef __int32_t       __darwin_dev_t;         /* dev_t */
          ^
  note: '__int128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:60:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_gid_t;         /* [???] process and group IDs */
          ^
  note: '__uint128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:61:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_id_t;          /* [XSI] pid_t, uid_t, or gid_t*/
          ^
  note: '__uint128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:62:9: error: unknown type name '__uint64_t'
  typedef __uint64_t      __darwin_ino64_t;       /* [???] Used for 64 bit inodes */
          ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t'
  typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
          ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:70:9: error: unknown type name '__uint16_t'; did you mean '__uint128_t'?
  typedef __uint16_t      __darwin_mode_t;        /* [???] Some file attributes */
          ^
  note: '__uint128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:71:9: error: unknown type name '__int64_t'
  typedef __int64_t       __darwin_off_t;         /* [???] Used for file sizes */
          ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:72:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
  typedef __int32_t       __darwin_pid_t;         /* [???] process and group IDs */
          ^
  note: '__int128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:73:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_sigset_t;      /* [???] signal set */
          ^
  note: '__uint128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:74:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
  typedef __int32_t       __darwin_suseconds_t;   /* [???] microseconds */
          ^
  note: '__int128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:75:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_uid_t;         /* [???] user IDs */
          ^
  note: '__uint128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_useconds_t;    /* [???] microseconds */
          ^
  note: '__uint128_t' declared here
  In file included from pyemd/emd.cpp:23:
  In file included from /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdio.h:107:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:71:
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_types.h:43:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_wctype_t;
          ^
  note: '__uint128_t' declared here
  In file included from pyemd/emd.cpp:23:
  In file included from /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdio.h:107:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:75:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types/_va_list.h:31:
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/types.h:37:2: error: architecture not supported
  #error architecture not supported
   ^
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  20 errors generated.
  error: command 'clang' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pyemd
  Running setup.py clean for pyemd
  Building wheel for wmd (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-install-rx5dmeye/wmd_57e02a8ba0d84ea9b543b6f6ea8afeab/setup.py'"'"'; __file__='"'"'/private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-install-rx5dmeye/wmd_57e02a8ba0d84ea9b543b6f6ea8afeab/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-wheel-slon_mgf
       cwd: /private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-install-rx5dmeye/wmd_57e02a8ba0d84ea9b543b6f6ea8afeab/
  Complete output (18 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.14.6-x86_64-3.8
  creating build/lib.macosx-10.14.6-x86_64-3.8/wmd
  copying wmd/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/wmd
  running build_ext
  building 'libwmdrelax' extension
  creating build/temp.macosx-10.14.6-x86_64-3.8
  creating build/temp.macosx-10.14.6-x86_64-3.8/or-tools
  creating build/temp.macosx-10.14.6-x86_64-3.8/or-tools/src
  creating build/temp.macosx-10.14.6-x86_64-3.8/or-tools/src/graph
  creating build/temp.macosx-10.14.6-x86_64-3.8/or-tools/src/base
  creating build/temp.macosx-10.14.6-x86_64-3.8/or-tools/src/util
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -I/Users/lmcgibbn/Library/Python/3.8/lib/python/site-packages/numpy/core/include -Ior-tools/src -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c python.cc -o build/temp.macosx-10.14.6-x86_64-3.8/python.o -std=c++11 -march=native -ftree-vectorize -DNDEBUG -Wno-sign-compare -fPIC -flto
  clang: error: the clang compiler does not support '-march=native'
  error: command 'clang' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for wmd
  Running setup.py clean for wmd
Failed to build pyemd wmd
Installing collected packages: wmd, werkzeug, urlextract, texttable, tensorboard-plugin-wit, stanza, spacy, sklearn, sacrebleu, qtconsole, pyzstd, pytorch-pretrained-bert, pyppmd, pyflakes, pyemd, pycryptodomex, pycodestyle, pybcj, pyarrow, psutil, platformdirs, pathspec, path.py, mypy-extensions, multivolumefile, multiprocess, moverscore, mccabe, markdown, jupyter-console, ipywidgets, icecream, huggingface-hub, grpcio, graphviz, google-auth-oauthlib, gin-config, fsspec, brotli, blanc, bert-score, beautifulsoup4, absl-py, tensorboard, summ-eval, sentencepiece, pytextrank, py7zr, progressbar, prettytable, lexrank, jupyter, gensim, gdown, flake8, datasets, cython, black, summertime
    Running setup.py install for wmd ... error
    ERROR: Command errored out with exit status 1:
     command: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-install-rx5dmeye/wmd_57e02a8ba0d84ea9b543b6f6ea8afeab/setup.py'"'"'; __file__='"'"'/private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-install-rx5dmeye/wmd_57e02a8ba0d84ea9b543b6f6ea8afeab/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-record-rsxxqcdw/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/lmcgibbn/Library/Python/3.8/include/python3.8/wmd
         cwd: /private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-install-rx5dmeye/wmd_57e02a8ba0d84ea9b543b6f6ea8afeab/
    Complete output (18 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.14.6-x86_64-3.8
    creating build/lib.macosx-10.14.6-x86_64-3.8/wmd
    copying wmd/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/wmd
    running build_ext
    building 'libwmdrelax' extension
    creating build/temp.macosx-10.14.6-x86_64-3.8
    creating build/temp.macosx-10.14.6-x86_64-3.8/or-tools
    creating build/temp.macosx-10.14.6-x86_64-3.8/or-tools/src
    creating build/temp.macosx-10.14.6-x86_64-3.8/or-tools/src/graph
    creating build/temp.macosx-10.14.6-x86_64-3.8/or-tools/src/base
    creating build/temp.macosx-10.14.6-x86_64-3.8/or-tools/src/util
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -I/Users/lmcgibbn/Library/Python/3.8/lib/python/site-packages/numpy/core/include -Ior-tools/src -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c python.cc -o build/temp.macosx-10.14.6-x86_64-3.8/python.o -std=c++11 -march=native -ftree-vectorize -DNDEBUG -Wno-sign-compare -fPIC -flto
    clang: error: the clang compiler does not support '-march=native'
    error: command 'clang' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-install-rx5dmeye/wmd_57e02a8ba0d84ea9b543b6f6ea8afeab/setup.py'"'"'; __file__='"'"'/private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-install-rx5dmeye/wmd_57e02a8ba0d84ea9b543b6f6ea8afeab/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-record-rsxxqcdw/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/lmcgibbn/Library/Python/3.8/include/python3.8/wmd Check the logs for full command output.

I searched the project issues and could not find any related issue so decided to open this one.
Is there a recommended way for me to build the project? Thank you

Query-based summarization model

As mentioned in the last meeting, we need to have query-based summarization models.

The current plan is to have a pipeline where we first retrive the related dialogue/sentences and use a single-doc summarization model to do the job.

Currently assigned to @zhangir-azerbayev

ROUGE-WE takes too long to load

@zhangir-azerbayev Currently in the demo, when we import the evaluation module, it would prompt "downloading embedding, this could take a while".

This download is repeated everytime we import the evaluation module, which is not really reasonable. I suspect that it is the ROUGE-we score, but needs to be confirmed

Another problem with evaluation is that the package name eval is in conflict with python keywords, so we should move everything to evaluation and update other references accordingly.

More Summarization Models

For the next steps, we would like to have the following models:

  • TextRank
  • BART (import this from huggingface; refer to the Pegasus model we already have)

Assigning this to @troyfeng116

Automatically adjust output length for models

Based on the fact that most models have a hyperparameter to adjust the maximum output length, it makes more sense to:

  • automatically calculate the avg. output length of the dataset
  • use this as a parameter to feed into the model

comprehensive explanation of metrics, models and dataset

Making sure that we have rather comprehensive descriptions/explanations of the metrics, models and datasets.

We should have methods to list all models/datasets/metrics, either in natural language describing them, or using something like prettytable to print tables in the readme to the console/notebook.

More detailed documentation

Our current documentation contains two parts:

  1. model/dataset/evaluation metrics contains methods that can directly out;
  2. The readme has a list of all the things that we have and some examples.

However, we may want some more detailed and well-formatted documentation about APIs. As an example, an integration with tools like Sphinx would be nice.

License

Hi can you please add a license file

HMNetModel cannot be load

Hi :)

I have problem with HMNetModel. I can't load it on yours Colab notebook.
I prepare code for this task:

from model import HMNetModel

hmn = HMNetModel()

I get error:

usage: ipykernel_launcher.py [-h] [--command COMMAND] [--conf_file CONF_FILE]
                             [--PYLEARN_MODEL PYLEARN_MODEL]
                             [--master_port MASTER_PORT] [--cluster CLUSTER]
                             [--dist_init_path DIST_INIT_PATH] [--fp16]
                             [--fp16_opt_level FP16_OPT_LEVEL] [--no_cuda]
                             [--config_overrides CONFIG_OVERRIDES]
ipykernel_launcher.py: error: unrecognized arguments: -f /root/.local/share/jupyter/runtime/kernel-d260cea4-6d66-4567-bbda-0e4a0fefba13.json
An exception has occurred, use %tb to see the full traceback.

SystemExit: 2

Do you know what's happen? Thanks in advance for your help :)

Try to avoid using relative import

I recently found that relative import can easily break things. So let's try to use absolute import.

In case someone doesn't know what this means: if you are trying to import SummModel in model/base_model.py from model/bart_model.py use from model.base_model import SummModel rather than from .base_model import SummModel

[Dataset] First example

  • add dependency to huggingface/dataset
  • have a wrapper class around huggingface's dataset for our own code?
  • have CNN/DM ready to use

Integration with SummEval

@MuroriM Alex just sent out an email about SummEval being pip installable now, can you give some progress information here about integrating it with SummerTime?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.