Transformers最初是由Google發布的論文 Attention is All You Need (2017) 提出的一種新的深度學習網絡架構,這篇論文證明了序列模型(如 LSTM)可以完全被注意力機制取代,甚至可以獲得更好的性能。Transformers網絡結構自2017年提出之后僅僅一兩年的時間內就一直在NLP領域及其子任務霸榜,目前的LLM大語言模型(ChatGPT、ChatGLM等)都是基于Transformers網絡架構。Transformers不僅在NLP領域表現出色,自2020年開始,Transformers開始席卷CV領域,一度有碾壓CV領域常用的CNN網絡結構。
率先實現Transformers 網絡模型架構的是 HuggingFace 的transformer庫,因此,目前我們通過調用transformer庫就可以幫助我們解決CV、NLP領域的絕大部分任務。transformers庫中支持的任務包括:
['audio-classification', 'automatic-speech-recognition', 'conversational', 'depth-estimation', 'document-question-answering', 'feature-extraction', 'fill-mask', 'image-classification', 'image-segmentation', 'image-to-text', 'mask-generation', 'ner', 'object-detection', 'question-answering', 'sentiment-analysis', 'summarization&