250x250
Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- spring MVC(모델2)방식
- 방식으로 텍스트
- 과학백과사전
- jsp 파일 설정
- pytorch
- 코사인 유사도
- 지마켓
- (깃)git bash
- Gmarket
- 파이썬
- 게시판 만들기
- 네이버뉴스
- 이력서
- test
- 자바
- mysql
- word2vec
- Topics
- r
- db
- lda
- Websocket
- tomoto
- 크롤링
- 幼稚园杀手(유치원킬러)
- Python
- java
- 토픽추출
- RESFUL
- oracle
Archives
- Today
- Total
무회blog
python: pytorch,transformer , pipline , 提问解答사용해보기 본문
In [6]:
from __future__ import print_function
import ipywidgets as widgets
from transformers import pipeline
print('success')
In [7]:
nlp_sentence_classif = pipeline('sentiment-analysis')
nlp_sentence_classif('Such a nice weather outside !')
Out[7]:
In [12]:
nlp_token_class = pipeline('ner')
nlp_token_class('Hugging Face is a French company based in New-York.')
Out[12]:
In [13]:
nlp_qa = pipeline('question-answering')
nlp_qa(context='Hugging Face is a French company based in New-York.', question='Where is based Hugging Face ?')
Out[13]:
In [16]:
dir(pipeline)
Out[16]:
In [ ]:
from transformers import BertForSequenceClassification
model = BertForSequenceClassification.from_pretrained('bert-base-uncased')
model.train()
'Python > TA' 카테고리의 다른 글
200814,test bert 001 (0) | 2020.08.14 |
---|---|
python: pytorch, model , train 시키기 , (0) | 2020.08.13 |
python: pytorch, 질의응답관련 , bert 사용 (0) | 2020.08.13 |
python: pytorch,Bert, 로 토큰나이징 하기 (0) | 2020.08.13 |
Comments