zombie_writer 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -3
- data/exe/zombie_writer +0 -0
- data/lib/zombie_writer.rb +10 -2
- data/lib/zombie_writer/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0affe2c286203bdb128f0796005ca21790e4ec7b
|
4
|
+
data.tar.gz: b7f415065c9b5f69ce3d803145b3d2eaa74269e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79fc4d480ed49db46b73e5955dcd081c2fc53d4e2f9e236a4159046ce4702a4acaa7109ef759e0119512fd3e49c07ee6790e22baa8e3e0579b2f1e7b817b258f
|
7
|
+
data.tar.gz: 8983e7f824531c1065a996761c794312a8cd37dccd379b277aedaae9469ddb3967482b460b3464ad0ede1f53da205a6b90c0e6b44dee877e55a2dec83f3398f0
|
data/README.md
CHANGED
@@ -4,7 +4,9 @@
|
|
4
4
|
|
5
5
|
ZombieWriter is a Ruby gem that will enable users to generate news articles by aggregating paragraphs from other sources.
|
6
6
|
|
7
|
-
While you have to provide the paragraphs,
|
7
|
+
While you have to provide the paragraphs, ZombieWriter will arrange the paragraphs into different articles for you to use and edit to your heart's content. You may choose between Machine Learning (Latent Semantic Analysis and k-means clustering) or Randomization.
|
8
|
+
|
9
|
+
For more information about how this program works, please read the blog post [Using Machine Learning To Generate Human-Readable News Articles](https://dev.to/tra/using-machine-learning-to-generate-human-readable-news-articles).
|
8
10
|
|
9
11
|
## Installation
|
10
12
|
|
@@ -20,6 +22,9 @@ gem install zombie_writer
|
|
20
22
|
gem 'zombie_writer'
|
21
23
|
```
|
22
24
|
|
25
|
+
### Additional Requirements
|
26
|
+
ZombieWriter also requires [GNU GSL](http://www.gnu.org/software/gsl) and [rb-gsl](https://rubygems.org/gems/rb-gsl) (a Ruby gem that interfaces with the GSL library). Please see [Issue #5](https://github.com/tra38/ZombieWriter/issues/5) for more information.
|
27
|
+
|
23
28
|
## Usage
|
24
29
|
First, decide whether you want to use ZombieWriter::MachineLearning or ZombieWriter::Randomization. ZombieWriter::MachineLearning uses Latent Semantic Analysis and k-means clustering to group your content into different articles, while Randomization simply pick random paragraphs to put in each article.
|
25
30
|
|
@@ -77,7 +82,7 @@ File.open("articles.md", "w+") do |f|
|
|
77
82
|
end
|
78
83
|
```
|
79
84
|
|
80
|
-
Here's an example article that might be generated by
|
85
|
+
Here's an example article that might be generated by ZombieWriter:
|
81
86
|
|
82
87
|
```markdown
|
83
88
|
## 0 - Lorem ipsum dolor sit amet.
|
@@ -143,7 +148,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
143
148
|
|
144
149
|
## Contributing
|
145
150
|
|
146
|
-
1. Fork it ( https://github.com/tra38/
|
151
|
+
1. Fork it ( https://github.com/tra38/ZombieWriter/fork )
|
147
152
|
2. Create your feature branch (git checkout -b my-new-feature)
|
148
153
|
3. Commit your changes (git commit -am 'Add some feature')
|
149
154
|
4. Push to the branch (git push origin my-new-feature)
|
data/exe/zombie_writer
CHANGED
File without changes
|
data/lib/zombie_writer.rb
CHANGED
@@ -18,8 +18,16 @@ module ZombieWriter
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def self.header(index, article_for_summarization)
|
21
|
-
|
22
|
-
|
21
|
+
begin
|
22
|
+
generated_title = ClassifierReborn::Summarizer.summary(article_for_summarization, 1)
|
23
|
+
rescue Exception
|
24
|
+
generated_title = nil
|
25
|
+
end
|
26
|
+
if generated_title
|
27
|
+
"## #{index} - #{generated_title}"
|
28
|
+
else
|
29
|
+
"## #{index}"
|
30
|
+
end
|
23
31
|
end
|
24
32
|
|
25
33
|
def self.formatted_article(header, final_article)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zombie_writer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tariq Ali
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
version: '0'
|
141
141
|
requirements: []
|
142
142
|
rubyforge_project:
|
143
|
-
rubygems_version: 2.
|
143
|
+
rubygems_version: 2.6.11
|
144
144
|
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: ZombieWriter is a Ruby gem that will enable users to generate news articles
|