English eowyn_gpt2_medium_x777 GPT2Transformer from stanford-crfm

Description

Pretrained GPT2Transformer model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP.eowyn_gpt2_medium_x777 is a English model originally trained by stanford-crfm.

Download Copy S3 URI

How to use

 
documentAssembler = DocumentAssembler() \
      .setInputCol("text") \
      .setOutputCol("document")

seq2seq = GPT2Transformer.pretrained("eowyn_gpt2_medium_x777","en") \
      .setInputCols(["documents"]) \
      .setOutputCol("generation")       
        
pipeline = Pipeline().setStages([documentAssembler, seq2seq])
data = spark.createDataFrame([["I love spark-nlp"]]).toDF("text")
pipelineModel = pipeline.fit(data)
pipelineDF = pipelineModel.transform(data)


val documentAssembler = new DocumentAssembler() 
    .setInputCol("text") 
    .setOutputCol("document")
    
val seq2seq = GPT2Transformer.pretrained("eowyn_gpt2_medium_x777","en") 
    .setInputCols(Array("documents")) 
    .setOutputCol("generation")

val pipeline = new Pipeline().setStages(Array(documentAssembler, seq2seq))
val data = Seq("I love spark-nlp").toDF("text")
val pipelineModel = pipeline.fit(data)
val pipelineDF = pipelineModel.transform(data)

Model Information

Model Name: eowyn_gpt2_medium_x777
Compatibility: Spark NLP 5.5.1+
License: Open Source
Edition: Official
Input Labels: [document]
Output Labels: [generation]
Language: en
Size: 852.3 MB

References

https://huggingface.co/stanford-crfm/eowyn-gpt2-medium-x777