0

我创建了一个简单的 macOS Playground 来制作 coreML 文本分类器,如下所示:

import Cocoa
import CreateML

let url = URL(string: "https://github.com/novinfard/profiler-sentiment-analysis/raw/master/ml-model/essays.csv")
let data = try MLDataTable(contentsOf: url!)
let (trainingData, testingData) = data.randomSplit(by: 0.8, seed: 5)
let sentimentClassifier = try MLTextClassifier(trainingData: trainingData,
                                               textColumn: "TEXT",
                                               labelColumn: "cEXT")
// Training accuracy as a percentage
let trainingAccuracy = (1.0 - sentimentClassifier.trainingMetrics.classificationError) * 100

// Validation accuracy as a percentage
let validationAccuracy = (1.0 - sentimentClassifier.validationMetrics.classificationError) * 100

print("training accuracy -> \(trainingAccuracy) validation accuracy ->\(validationAccuracy)")

但我收到“执行被中断”错误。

这是过程中的日志:

Parsing completed. Parsed 100 lines in 0.078347 secs.
Finished parsing file https://github.com/novinfard/profiler-sentiment-analysis/raw/master/ml-model/essays.csv
Parsing completed. Parsed 2467 lines in 0.113062 secs.
Automatically generating validation set from 5% of the data.
Tokenizing data and extracting features

我该如何解决?

4

0 回答 0