jordiclive commited on
Commit
1cba3a1
·
1 Parent(s): a40b6f3

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +0 -155
README.md CHANGED
@@ -22,123 +22,10 @@ datasets:
22
  - TLDR
23
  metrics:
24
  - rouge
25
- widget:
26
- - text: >-
27
- large earthquakes along a given fault segment do not occur at random
28
- intervals because it takes time to accumulate the strain energy for the
29
- rupture. The rates at which tectonic plates move and accumulate strain at
30
- their boundaries are approximately uniform. Therefore, in first
31
- approximation, one may expect that large ruptures of the same fault segment
32
- will occur at approximately constant time intervals. If subsequent main
33
- shocks have different amounts of slip across the fault, then the recurrence
34
- time may vary, and the basic idea of periodic mainshocks must be modified.
35
- For great plate boundary ruptures the length and slip often vary by a factor
36
- of 2. Along the southern segment of the San Andreas fault the recurrence
37
- interval is 145 years with variations of several decades. The smaller the
38
- standard deviation of the average recurrence interval, the more specific
39
- could be the long term prediction of a future mainshock.
40
- example_title: earthquakes
41
- - text: ' A typical feed-forward neural field algorithm. Spatiotemporal coordinates are fed into a neural network that predicts values in the reconstructed domain. Then, this domain is mapped to the sensor domain where sensor measurements are available as supervision. Class and Section Problems Addressed Generalization (Section 2) Inverse problems, ill-posed problems, editability; symmetries. Hybrid Representations (Section 3) Computation & memory efficiency, representation capacity, editability: Forward Maps (Section 4) Inverse problems Network Architecture (Section 5) Spectral bias, integration & derivatives. Manipulating Neural Fields (Section 6) Edit ability, constraints, regularization. Table 2: The five classes of techniques in the neural field toolbox each addresses problems that arise in learning, inference, and control. (Section 3). We can supervise reconstruction via differentiable forward maps that transform Or project our domain (e.g, 3D reconstruction via 2D images; Section 4) With appropriate network architecture choices, we can overcome neural network spectral biases (blurriness) and efficiently compute derivatives and integrals (Section 5). Finally, we can manipulate neural fields to add constraints and regularizations, and to achieve editable representations (Section 6). Collectively, these classes constitute a ''toolbox'' of techniques to help solve problems with neural fields There are three components in a conditional neural field: (1) An encoder or inference function € that outputs the conditioning latent variable 2 given an observation 0 E(0) =2. 2 is typically a low-dimensional vector, and is often referred to aS a latent code Or feature code_ (2) A mapping function 4 between Z and neural field parameters O: Y(z) = O; (3) The neural field itself $. The encoder € finds the most probable z given the observations O: argmaxz P(2/0). The decoder maximizes the inverse conditional probability to find the most probable 0 given Z: arg- max P(Olz). We discuss different encoding schemes with different optimality guarantees (Section 2.1.1), both global and local conditioning (Section 2.1.2), and different mapping functions Y (Section 2.1.3) 2. Generalization Suppose we wish to estimate a plausible 3D surface shape given a partial or noisy point cloud. We need a suitable prior over the sur- face in its reconstruction domain to generalize to the partial observations. A neural network expresses a prior via the function space of its architecture and parameters 0, and generalization is influenced by the inductive bias of this function space (Section 5).'
42
- example_title: scientific paper
43
- - text: ' the big variety of data coming from diverse sources is one of the key properties of the big data phenomenon. It is, therefore, beneficial to understand how data is generated in various environments and scenarios, before looking at what should be done with this data and how to design the best possible architecture to accomplish this The evolution of IT architectures, described in Chapter 2, means that the data is no longer processed by a few big monolith systems, but rather by a group of services In parallel to the processing layer, the underlying data storage has also changed and became more distributed This, in turn, required a significant paradigm shift as the traditional approach to transactions (ACID) could no longer be supported. On top of this, cloud computing is becoming a major approach with the benefits of reducing costs and providing on-demand scalability but at the same time introducing concerns about privacy, data ownership, etc In the meantime the Internet continues its exponential growth: Every day both structured and unstructured data is published and available for processing: To achieve competitive advantage companies have to relate their corporate resources to external services, e.g. financial markets, weather forecasts, social media, etc While several of the sites provide some sort of API to access the data in a more orderly fashion; countless sources require advanced web mining and Natural Language Processing (NLP) processing techniques: Advances in science push researchers to construct new instruments for observing the universe O conducting experiments to understand even better the laws of physics and other domains. Every year humans have at their disposal new telescopes, space probes, particle accelerators, etc These instruments generate huge streams of data, which need to be stored and analyzed. The constant drive for efficiency in the industry motivates the introduction of new automation techniques and process optimization: This could not be done without analyzing the precise data that describe these processes. As more and more human tasks are automated, machines provide rich data sets, which can be analyzed in real-time to drive efficiency to new levels. Finally, it is now evident that the growth of the Internet of Things is becoming a major source of data. More and more of the devices are equipped with significant computational power and can generate a continuous data stream from their sensors. In the subsequent sections of this chapter, we will look at the domains described above to see what they generate in terms of data sets. We will compare the volumes but will also look at what is characteristic and important from their respective points of view. 3.1 The Internet is undoubtedly the largest database ever created by humans. While several well described; cleaned, and structured data sets have been made available through this medium, most of the resources are of an ambiguous, unstructured, incomplete or even erroneous nature. Still, several examples in the areas such as opinion mining, social media analysis, e-governance, etc, clearly show the potential lying in these resources. Those who can successfully mine and interpret the Internet data can gain unique insight and competitive advantage in their business An important area of data analytics on the edge of corporate IT and the Internet is Web Analytics.'
44
- example_title: data science textbook
45
- - text: >-
46
- Transformer-based models have shown to be very useful for many NLP tasks.
47
- However, a major limitation of transformers-based models is its O(n^2)O(n 2)
48
- time & memory complexity (where nn is sequence length). Hence, it's
49
- computationally very expensive to apply transformer-based models on long
50
- sequences n > 512n>512. Several recent papers, e.g. Longformer, Performer,
51
- Reformer, Clustered attention try to remedy this problem by approximating
52
- the full attention matrix. You can checkout 🤗's recent blog post in case
53
- you are unfamiliar with these models.
54
-
55
- BigBird (introduced in paper) is one of such recent models to address this
56
- issue. BigBird relies on block sparse attention instead of normal attention
57
- (i.e. BERT's attention) and can handle sequences up to a length of 4096 at a
58
- much lower computational cost compared to BERT. It has achieved SOTA on
59
- various tasks involving very long sequences such as long documents
60
- summarization, question-answering with long contexts.
61
-
62
- BigBird RoBERTa-like model is now available in 🤗Transformers. The goal of
63
- this post is to give the reader an in-depth understanding of big bird
64
- implementation & ease one's life in using BigBird with 🤗Transformers. But,
65
- before going into more depth, it is important to remember that the BigBird's
66
- attention is an approximation of BERT's full attention and therefore does
67
- not strive to be better than BERT's full attention, but rather to be more
68
- efficient. It simply allows to apply transformer-based models to much longer
69
- sequences since BERT's quadratic memory requirement quickly becomes
70
- unbearable. Simply put, if we would have ∞ compute & ∞ time, BERT's
71
- attention would be preferred over block sparse attention (which we are going
72
- to discuss in this post).
73
-
74
- If you wonder why we need more compute when working with longer sequences,
75
- this blog post is just right for you!
76
-
77
- Some of the main questions one might have when working with standard
78
- BERT-like attention include:
79
-
80
- Do all tokens really have to attend to all other tokens? Why not compute
81
- attention only over important tokens? How to decide what tokens are
82
- important? How to attend to just a few tokens in a very efficient way? In
83
- this blog post, we will try to answer those questions.
84
-
85
- What tokens should be attended to? We will give a practical example of how
86
- attention works by considering the sentence 'BigBird is now available in
87
- HuggingFace for extractive question answering'. In BERT-like attention,
88
- every word would simply attend to all other tokens.
89
-
90
- Let's think about a sensible choice of key tokens that a queried token
91
- actually only should attend to by writing some pseudo-code. Will will assume
92
- that the token available is queried and build a sensible list of key tokens
93
- to attend to.
94
-
95
- >>> # let's consider following sentence as an example >>> example =
96
- ['BigBird', 'is', 'now', 'available', 'in', 'HuggingFace', 'for',
97
- 'extractive', 'question', 'answering']
98
-
99
- >>> # further let's assume, we're trying to understand the representation of
100
- 'available' i.e. >>> query_token = 'available' >>> # We will initialize an
101
- empty `set` and fill up the tokens of our interest as we proceed in this
102
- section. >>> key_tokens = [] # => currently 'available' token doesn't have
103
- anything to attend Nearby tokens should be important because, in a sentence
104
- (sequence of words), the current word is highly dependent on neighboring
105
- past & future tokens. This intuition is the idea behind the concept of
106
- sliding attention.
107
- example_title: bigbird blog intro
108
- - text: >-
109
- The majority of available text summarization datasets include short-form
110
- source documents that lack long-range causal and temporal dependencies, and
111
- often contain strong layout and stylistic biases. While relevant, such
112
- datasets will offer limited challenges for future generations of text
113
- summarization systems. We address these issues by introducing BookSum, a
114
- collection of datasets for long-form narrative summarization. Our dataset
115
- covers source documents from the literature domain, such as novels, plays
116
- and stories, and includes highly abstractive, human written summaries on
117
- three levels of granularity of increasing difficulty: paragraph-, chapter-,
118
- and book-level. The domain and structure of our dataset poses a unique set
119
- of challenges for summarization systems, which include: processing very long
120
- documents, non-trivial causal and temporal dependencies, and rich discourse
121
- structures. To facilitate future work, we trained and evaluated multiple
122
- extractive and abstractive summarization models as baselines for our
123
- dataset.
124
- example_title: BookSum Abstract
125
- inference:
126
- parameters:
127
- max_length: 64
128
- min_length: 8
129
- no_repeat_ngram_size: 3
130
- early_stopping: true
131
- repetition_penalty: 3.5
132
- length_penalty: 0.3
133
- encoder_no_repeat_ngram_size: 3
134
- num_beams: 4
135
  ---
136
 
137
  # Multi-purpose Summarizer (Fine-tuned 3B google/flan-t5-xl on several Summarization datasets)
138
 
139
- <a href="https://colab.research.google.com/gist/pszemraj/3eba944ddc9fc9a4a1bfb21e83b57620/summarization-token-batching.ipynb">
140
- <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
141
- </a>
142
 
143
  A fine-tuned version of [google/flan-t5-xl](https://huggingface.co/google/flan-t5-xl) on various summarization datasets (xsum, wikihow, cnn_dailymail/3.0.0, samsum, scitldr/AIC, billsum, TLDR)
144
 
@@ -153,47 +40,6 @@ Goal: a model that can be used for a general-purpose summarizer for academic and
153
 
154
  # Usage - Basic
155
 
156
- - use `encoder_no_repeat_ngram_size=3` when calling the pipeline object to improve summary quality.
157
- - this forces the model to use new vocabulary and create an abstractive summary, otherwise it may compile the best _extractive_ summary from the input provided.
158
-
159
- Load the model into a pipeline object:
160
-
161
- ```python
162
- import torch
163
- from transformers import pipeline
164
-
165
- hf_name = 'pszemraj/led-large-book-summary'
166
-
167
- summarizer = pipeline(
168
- "summarization",
169
- hf_name,
170
- device=0 if torch.cuda.is_available() else -1,
171
- )
172
- ```
173
-
174
- - put words into the pipeline object:
175
-
176
- ```python
177
- wall_of_text = "your words here"
178
-
179
- result = summarizer(
180
- wall_of_text,
181
- min_length=16,
182
- max_length=256,
183
- no_repeat_ngram_size=3,
184
- encoder_no_repeat_ngram_size=3,
185
- repetition_penalty=3.5,
186
- num_beams=4,
187
- early_stopping=True,
188
- )
189
- ```
190
-
191
-
192
- **Important:** To generate the best quality summaries, you should use the global attention mask when decoding, as demonstrated in [this community notebook here](https://colab.research.google.com/drive/12INTTR6n64TzS4RrXZxMSXfrOd9Xzamo?usp=sharing), see the definition of `generate_answer(batch)`.
193
-
194
- If having computing constraints, try the base version [`pszemraj/led-base-book-summary`](https://huggingface.co/pszemraj/led-base-book-summary)
195
- - all the parameters for generation on the API here are the same as [the base model](https://huggingface.co/pszemraj/led-base-book-summary) for easy comparison between versions.
196
-
197
  ## Training procedure
198
 
199
  - Training was done in BF16, deepspeed stage 2 for 6 epochs with ROUGE2 monitored on the validation set.
@@ -201,7 +47,6 @@ If having computing constraints, try the base version [`pszemraj/led-base-book-s
201
  ## Hardware
202
  - GPU count 8 NVIDIA A100-SXM4-40GB
203
  - CPU count 48
204
- -
205
  ### Training hyperparameters
206
 
207
 
 
22
  - TLDR
23
  metrics:
24
  - rouge
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  ---
26
 
27
  # Multi-purpose Summarizer (Fine-tuned 3B google/flan-t5-xl on several Summarization datasets)
28
 
 
 
 
29
 
30
  A fine-tuned version of [google/flan-t5-xl](https://huggingface.co/google/flan-t5-xl) on various summarization datasets (xsum, wikihow, cnn_dailymail/3.0.0, samsum, scitldr/AIC, billsum, TLDR)
31
 
 
40
 
41
  # Usage - Basic
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  ## Training procedure
44
 
45
  - Training was done in BF16, deepspeed stage 2 for 6 epochs with ROUGE2 monitored on the validation set.
 
47
  ## Hardware
48
  - GPU count 8 NVIDIA A100-SXM4-40GB
49
  - CPU count 48
 
50
  ### Training hyperparameters
51
 
52