def ovr_model(X_train, X_test, y_train, y_test, labels, seed, params=None):
    # set parameters for pipeline for each estimator of the OvR model
    if params is not None:
        pipeline = Pipeline([
            ('count_vectorizer', CountVectorizer()),
            ('tf', TfidfTransformer()),
            ('svc', LinearSVC(dual=False, max_iter=10e4, random_state=seed)),
        ])
        ovr = OneVsRestClassifier(pipeline)
        ovr.estimators_ = [copy.deepcopy(pipeline) for i in range(len(labels))]
        for idx in range(len(labels)):
            ovr.estimators_[idx].set_params(**params[labels[idx]])
    # use simpler model where each estimator of the OvR model is equal
    else:
        pipeline = Pipeline([
            ('count_vectorizer', CountVectorizer()),
            ('tf', TfidfTransformer(sublinear_tf=True)),
            ('svc',
             LinearSVC(C=0.1,
                       penalty='l1',
                       class_weight='balanced',
                       dual=False,
                       max_iter=10e4,
                       random_state=seed)),
        ])
        ovr = OneVsRestClassifier(pipeline)
    # train and predict model
    start_time = time.time()
    ovr.fit(X_train, y_train)
    prediction = ovr.predict(X_test)
    stop_time = time.time()
    # calculate scores
    f1 = f1_score(y_test, prediction, average=None)
    accuracy = jaccard_score(y_test, prediction, average=None)

    return f1, accuracy, stop_time - start_time