You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have made a pipeline which takes the sindhi poetry and the label, generate the embeddings and then finally perform the classifier dl available in the pyspark. The code is :
documentAssembler = DocumentAssembler()
.setInputCol("Couplet")
.setOutputCol("document")
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have made a pipeline which takes the sindhi poetry and the label, generate the embeddings and then finally perform the classifier dl available in the pyspark. The code is :
documentAssembler = DocumentAssembler()
.setInputCol("Couplet")
.setOutputCol("document")
tokenizer = Tokenizer()
.setInputCols(["document"])
.setOutputCol("token")
normalizer = Normalizer()
.setInputCols(["token"])
.setOutputCol("normalized")
stopwords_cleaner = StopWordsCleaner()
.setInputCols("normalized")
.setOutputCol("cleanTokens")
.setCaseSensitive(False)
Use WordEmbeddings instead of WordEmbeddingsModel
word_embeddings = WordEmbeddingsModel.pretrained("w2v_cc_300d","sd")
.setInputCols(["document", "cleanTokens"])
.setOutputCol("embeddings")
Use SentenceEmbeddings for obtaining sentence embeddings
sentence_embeddings = SentenceEmbeddings()
.setInputCols(["document", "embeddings"])
.setOutputCol("sentence_embeddings")
.setPoolingStrategy("AVERAGE")
embeddings_finisher = EmbeddingsFinisher() \
.setInputCols(["sentence_embeddings"]) \
.setOutputCols(["finished_sentence_embeddings"]) \
.setOutputAsVector(True)\
.setCleanAnnotations(False)
classsifierdl = ClassifierDLApproach()
.setInputCols(["sentence_embeddings"])
.setOutputCol("class")
.setEnableOutputLogs(True)
.setLabelColumn("Poet")
.setMaxEpochs(20)
.setBatchSize(32)
sindhi_pip = Pipeline(stages=[documentAssembler, tokenizer, normalizer, stopwords_cleaner, word_embeddings, sentence_embeddings,
classsifierdl])
and the error is :
Beta Was this translation helpful? Give feedback.
All reactions