Description
Pretrained RoBertaForSequenceClassification model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP. TweetClimateAnalysis
is a English model originally trained by KeithHorgan
.
Predicted Entities
Global warming is not happening - Sea level rise is exaggerated/not accelerating
, Climate impacts/global warming is beneficial/not bad -Species/plants/reefs aren’t showing climate impacts/are benefiting from climate change
, Global warming is not happening - Extreme weather isn’t increasing/has happened before/isn’t linked to climate change
, Climate solutions won’t work - Climate policies areineffective/flawed
, Climate solutions won’t work - People need energy (e.g. from fossil fuels/nuclear)
, No claim
, Global warming is not happening - Climate hasn’t warmed/changed over the last (few) decade(s)
, Climate movement/science is unreliable - Climate movement is unreliable/alarmist/corrupt
, Climate impacts/global warming is beneficial/not bad -Climate sensitivity is low/negative feedbacks reduce warming
, Global warming is not happening - Ice/permafrost/snow cover isn’t melting
, Global warming is not happening - Weather is cold/snowing
, Climate solutions won’t work - Climate policies (mitigation or adaptation) are harmful
, Human greenhouse gases are not causing climate change - It’s natural cycles/variation
, Climate impacts/global warming is beneficial/not bad -CO2 is beneficial/not a pollutant
, Climate solutions won’t work - Clean energy technology/biofuels won’t work
, Global warming is not happening - We’re heading into an ice age/global cooling
, Human greenhouse gases are not causing climate change - There’s no evidence for greenhouse effect/carbon dioxide driving climate change
How to use
documentAssembler = DocumentAssembler() \
.setInputCol("text") \
.setOutputCol("document")
tokenizer = Tokenizer() \
.setInputCols("document") \
.setOutputCol("token")
seq_classifier = RoBertaForSequenceClassification.pretrained("roberta_classifier_tweetclimateanalysis","en") \
.setInputCols(["document", "token"]) \
.setOutputCol("class")
pipeline = Pipeline(stages=[documentAssembler, tokenizer, seq_classifier])
data = spark.createDataFrame([["PUT YOUR STRING HERE"]]).toDF("text")
result = pipeline.fit(data).transform(data)
val documentAssembler = new DocumentAssembler()
.setInputCols(Array("text"))
.setOutputCols(Array("document"))
val tokenizer = new Tokenizer()
.setInputCols("document")
.setOutputCol("token")
val seq_classifier = RoBertaForSequenceClassification.pretrained("roberta_classifier_tweetclimateanalysis","en")
.setInputCols(Array("document", "token"))
.setOutputCol("class")
val pipeline = new Pipeline().setStages(Array(documentAssembler, tokenizer, seq_classifier))
val data = Seq("PUT YOUR STRING HERE").toDS.toDF("text")
val result = pipeline.fit(data).transform(data)
import nlu
nlu.load("en.classify.roberta.tweet.by_keithhorgan").predict("""PUT YOUR STRING HERE""")
Model Information
Model Name: | roberta_classifier_tweetclimateanalysis |
Compatibility: | Spark NLP 5.4.2+ |
License: | Open Source |
Edition: | Official |
Input Labels: | [document, token] |
Output Labels: | [class] |
Language: | en |
Size: | 1.3 GB |
References
References
- https://huggingface.co/KeithHorgan/TweetClimateAnalysis