tingxinli commited on
Commit
1647d40
1 Parent(s): 16da52b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -10
README.md CHANGED
@@ -43,10 +43,8 @@ pip install transformers==4.35.0
43
  下面是通过hide完成信息匿名化的一个例子。
44
  ```ipython
45
  from transformers import AutoTokenizer, AutoModelForCausalLM
46
- tokenizer = AutoTokenizer.from_pretrained("tingxinli/
47
- HaS-820m")
48
- model = AutoModelForCausalLM.from_pretrained("tingxinli/
49
- HaS-820m").to('cuda:0')
50
  hide_template = """<s>Paraphrase the text:%s\n\n"""
51
  original_input = "张伟用苹果(iPhone 13)换了一箱好吃的苹果。"
52
  input_text = hide_template % original_input
@@ -63,10 +61,8 @@ print(hide_input)
63
  下面是通过seek完成摘要还原的一个例子。
64
  ```ipython
65
  from transformers import AutoTokenizer, AutoModelForCausalLM
66
- tokenizer = AutoTokenizer.from_pretrained("tingxinli/
67
- HaS-820m")
68
- model = AutoModelForCausalLM.from_pretrained("tingxinli/
69
- HaS-820m").to('cuda:0')
70
  seek_template = "Convert the text:\n%s\n\n%s\n\nConvert the text:\n%s\n\n"
71
  hide_input = "前天,'2022北京海淀·颐和园经贸合作洽谈会成功举行,各大媒体竞相报道了活动盛况,小李第一时间将昨天媒体报道情况进行了整理。人民日报 中国青年网 国际联合报 北京商报 消费者观察报 上海晚报 杭州日报 海峡晚报 北京日报 北京市电视一台?北京新闻 人民网 手机雅虎网 网易北京 长三角经济网 新京网 中国农业新闻网 北京圆桌 居然有这么多!还有部分媒体将在未来一周陆续发稿,为经洽会点!为海淀点!阅读投诉阅读精选留言加载中以上留言由公众号筛选后显示了解留言功能详情"
72
  hide_output = "2022北京海淀·颐和园经贸合作洽谈会成功举办,各大媒体广泛报道"
@@ -88,8 +84,7 @@ print(original_output)
88
  from hideAndSeek import *
89
 
90
  tokenizer = AutoTokenizer.from_pretrained("tingxinli/HaS-820m")
91
- model = AutoModelForCausalLM.from_pretrained("tingxinli/
92
- HaS-820m").to('cuda:0')
93
 
94
  original_input = "华纳兄弟影业(Warner Bro)著名的作品有《蝙蝠侠》系列、《超人》系列、《黑客帝国》系列和《指环王》系列。目前华纳未考虑推出《蝙蝠侠》系列新作。"
95
  print('original input:', original_input)
 
43
  下面是通过hide完成信息匿名化的一个例子。
44
  ```ipython
45
  from transformers import AutoTokenizer, AutoModelForCausalLM
46
+ tokenizer = AutoTokenizer.from_pretrained("tingxinli/HaS-820m")
47
+ model = AutoModelForCausalLM.from_pretrained("tingxinli/HaS-820m").to('cuda:0')
 
 
48
  hide_template = """<s>Paraphrase the text:%s\n\n"""
49
  original_input = "张伟用苹果(iPhone 13)换了一箱好吃的苹果。"
50
  input_text = hide_template % original_input
 
61
  下面是通过seek完成摘要还原的一个例子。
62
  ```ipython
63
  from transformers import AutoTokenizer, AutoModelForCausalLM
64
+ tokenizer = AutoTokenizer.from_pretrained("tingxinli/HaS-820m")
65
+ model = AutoModelForCausalLM.from_pretrained("tingxinli/HaS-820m").to('cuda:0')
 
 
66
  seek_template = "Convert the text:\n%s\n\n%s\n\nConvert the text:\n%s\n\n"
67
  hide_input = "前天,'2022北京海淀·颐和园经贸合作洽谈会成功举行,各大媒体竞相报道了活动盛况,小李第一时间将昨天媒体报道情况进行了整理。人民日报 中国青年网 国际联合报 北京商报 消费者观察报 上海晚报 杭州日报 海峡晚报 北京日报 北京市电视一台?北京新闻 人民网 手机雅虎网 网易北京 长三角经济网 新京网 中国农业新闻网 北京圆桌 居然有这么多!还有部分媒体将在未来一周陆续发稿,为经洽会点!为海淀点!阅读投诉阅读精选留言加载中以上留言由公众号筛选后显示了解留言功能详情"
68
  hide_output = "2022北京海淀·颐和园经贸合作洽谈会成功举办,各大媒体广泛报道"
 
84
  from hideAndSeek import *
85
 
86
  tokenizer = AutoTokenizer.from_pretrained("tingxinli/HaS-820m")
87
+ model = AutoModelForCausalLM.from_pretrained("tingxinli/HaS-820m").to('cuda:0')
 
88
 
89
  original_input = "华纳兄弟影业(Warner Bro)著名的作品有《蝙蝠侠》系列、《超人》系列、《黑客帝国》系列和《指环王》系列。目前华纳未考虑推出《蝙蝠侠》系列新作。"
90
  print('original input:', original_input)