Seungjun commited on
Commit
008d326
1 Parent(s): 03ce6f3

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +32 -0
README.md CHANGED
@@ -10,6 +10,38 @@ model-index:
10
  <!-- This model card has been generated automatically according to the information Keras had access to. You should
11
  probably proofread and complete it, then remove this comment. -->
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  # textSummaryV10
14
 
15
  This model is a fine-tuned version of [t5-small](https://huggingface.co/t5-small) on an unknown dataset.
 
10
  <!-- This model card has been generated automatically according to the information Keras had access to. You should
11
  probably proofread and complete it, then remove this comment. -->
12
 
13
+
14
+ # How to use the model
15
+
16
+ ```python
17
+ # Load tokenizer and model
18
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
19
+
20
+ tokenizer = AutoTokenizer.from_pretrained("Seungjun/textSummaryV10")
21
+ model = TFAutoModelForSeq2SeqLM.from_pretrained("Seungjun/textSummaryV10")
22
+ ```
23
+
24
+ ```python
25
+ # Get the original text - text you want to summarize
26
+ original = """
27
+ Neural networks, also known as artificial neural networks (ANNs) or simulated neural networks (SNNs), are a subset of machine learning and are at the heart of deep learning algorithms. Their name and structure are inspired by the human brain, mimicking the way that biological neurons signal to one another.
28
+ Artificial neural networks (ANNs) are comprised of a node layers, containing an input layer, one or more hidden layers, and an output layer. Each node, or artificial neuron, connects to another and has an associated weight and threshold. If the output of any individual node is above the specified threshold value, that node is activated, sending data to the next layer of the network. Otherwise, no data is passed along to the next layer of the network.
29
+ Neural networks rely on training data to learn and improve their accuracy over time. However, once these learning algorithms are fine-tuned for accuracy, they are powerful tools in computer science and artificial intelligence, allowing us to classify and cluster data at a high velocity. Tasks in speech recognition or image recognition can take minutes versus hours when compared to the manual identification by human experts. One of the most well-known neural networks is Google’s search algorithm.
30
+ """
31
+ ```
32
+
33
+ ```python
34
+ # Now summarize the original text using pipline method
35
+ from transformers import pipeline
36
+
37
+ summarizer = pipeline("summarization", model=model, tokenizer=tokenizer, framework="tf")
38
+ summarizer(
39
+ original,
40
+ min_length=20,
41
+ max_length=1024,
42
+ )
43
+ ```
44
+
45
  # textSummaryV10
46
 
47
  This model is a fine-tuned version of [t5-small](https://huggingface.co/t5-small) on an unknown dataset.