Description
Pretrained T5ForConditionalGeneration model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP. doc2query-t5-base-msmarco
is a English model originally trained by macavaney
.
How to use
documentAssembler = DocumentAssembler() \
.setInputCols("text") \
.setOutputCols("document")
t5 = T5Transformer.pretrained("t5_doc2query_base_msmarco","en") \
.setInputCols("document") \
.setOutputCol("answers")
pipeline = Pipeline(stages=[documentAssembler, t5])
data = spark.createDataFrame([["PUT YOUR STRING HERE"]]).toDF("text")
result = pipeline.fit(data).transform(data)
val documentAssembler = new DocumentAssembler()
.setInputCols("text")
.setOutputCols("document")
val t5 = T5Transformer.pretrained("t5_doc2query_base_msmarco","en")
.setInputCols("document")
.setOutputCol("answers")
val pipeline = new Pipeline().setStages(Array(documentAssembler, t5))
val data = Seq("PUT YOUR STRING HERE").toDS.toDF("text")
val result = pipeline.fit(data).transform(data)
Model Information
Model Name: | t5_doc2query_base_msmarco |
Compatibility: | Spark NLP 4.3.0+ |
License: | Open Source |
Edition: | Official |
Input Labels: | [documents] |
Output Labels: | [t5] |
Language: | en |
Size: | 474.3 MB |
References
- https://huggingface.co/macavaney/doc2query-t5-base-msmarco
- https://git.uwaterloo.ca/jimmylin/doc2query-data/raw/master/T5-passage/t5-base.zip
- https://github.com/terrierteam/pyterrier_doc2query
- https://cs.uwaterloo.ca/~jimmylin/publications/Nogueira_Lin_2019_docTTTTTquery-v2.pdf
- https://arxiv.org/abs/2007.14271