Comments (1)
We use the label vocabulary from the Gector available here. For our project, we do not need the @@UNKNOWN@@
and @@PADDING@@
labels since they are added automatically because of Gector's implementation of the Allennlp library.
Weighted Sampler
The label vocabulary contains 5,000 labels for 9 categories; keep
, delete
, replace
, append
, merge
, transform case
, transform verb
, transform agreement
and transform split
. The number of labels in each category is shown in the graph below.
Randomly sampling the action label will be inefficient for the following reasons:
- The probability of a random correct guess is really low because of the high action space.
- Some labels like
keep
,replace
andappend
occur more often than other labels. - Randomly deleting tokens will lose the information from the original sentence.
- Randomly appending tokens will change the context of the original sentence.
Therefore, we created a weighted sampler that generates some action labels more often than others.
Lines 5 to 48 in 2e9aff2
Test
For the test, we used the following label weights in the WeightedSampler
:
{
"$KEEP": 3.0,
"$MERGE": 0.1,
"$DELETE": 0.3,
"$APPEND": 0.5,
"$REPLACE": 1.0,
"$TRANSFORM_SPLIT": 0.2,
"$TRANSFORM_CASE": 1.0,
"$TRANSFORM_VERB": 1.0,
"$TRANSFORM_AGREEMENT": 1.0,
}
Using the above weights, we sampled different amounts of samples.
The sample above depicts the scenario where we randomly sample the action labels for a sentence with 10 tokens. Because of the high weight on the keep
label, most of the random labels are in this category.
The sample above depicts the likelihood of sampling different action labels during the training stage.
from drl-gec.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drl-gec.