100% found this document useful (2 votes)
322 views

Full download Natural Language Processing in Action Understanding analyzing and generating text with Python 1st Edition Hobson Lane pdf docx

Understanding

Uploaded by

gesindamonn0
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
322 views

Full download Natural Language Processing in Action Understanding analyzing and generating text with Python 1st Edition Hobson Lane pdf docx

Understanding

Uploaded by

gesindamonn0
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Get ebook downloads in full at ebookmeta.

com

Natural Language Processing in Action


Understanding analyzing and generating text with
Python 1st Edition Hobson Lane

https://ebookmeta.com/product/natural-language-processing-
in-action-understanding-analyzing-and-generating-text-with-
python-1st-edition-hobson-lane/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Natural Language Processing in Action - Second Edition


(MEAP V08) Hobson Lane

https://ebookmeta.com/product/natural-language-processing-in-action-
second-edition-meap-v08-hobson-lane/

ebookmeta.com

Natural Language Processing in Action Second Edition MEAP


V11 Hobson Lane Maria Dyshel

https://ebookmeta.com/product/natural-language-processing-in-action-
second-edition-meap-v11-hobson-lane-maria-dyshel/

ebookmeta.com

Practical Natural Language Processing with Python: With


Case Studies from Industries Using Text Data at Scale 1st
Edition Mathangi Sri
https://ebookmeta.com/product/practical-natural-language-processing-
with-python-with-case-studies-from-industries-using-text-data-at-
scale-1st-edition-mathangi-sri-2/
ebookmeta.com

The Right to be Forgotten 2nd Edition Paul Lambert

https://ebookmeta.com/product/the-right-to-be-forgotten-2nd-edition-
paul-lambert/

ebookmeta.com
Aligning Climate Change and Sustainable Development
Policies in Asia 1st Edition Hooman Farzaneh

https://ebookmeta.com/product/aligning-climate-change-and-sustainable-
development-policies-in-asia-1st-edition-hooman-farzaneh/

ebookmeta.com

Virtual You How Building Your Digital Twin Will


Revolutionize Medicine and Change Your Life 1st Edition
Peter Coveney
https://ebookmeta.com/product/virtual-you-how-building-your-digital-
twin-will-revolutionize-medicine-and-change-your-life-1st-edition-
peter-coveney/
ebookmeta.com

Fighting the People s War 1st Edition Jonathan Fennell

https://ebookmeta.com/product/fighting-the-people-s-war-1st-edition-
jonathan-fennell/

ebookmeta.com

Be Exceptional: Master the Five Traits That Set


Extraordinary People Apart 1st Edition Joe Navarro

https://ebookmeta.com/product/be-exceptional-master-the-five-traits-
that-set-extraordinary-people-apart-1st-edition-joe-navarro/

ebookmeta.com

Critical Reflections on Constitutional Democracy in the


European Union Sacha Garben Editor Inge Govaere Editor
Paul Nemitz Editor
https://ebookmeta.com/product/critical-reflections-on-constitutional-
democracy-in-the-european-union-sacha-garben-editor-inge-govaere-
editor-paul-nemitz-editor/
ebookmeta.com
The Shadows Black Dagger Brotherhood 13 First Edition J R
Ward

https://ebookmeta.com/product/the-shadows-black-dagger-
brotherhood-13-first-edition-j-r-ward/

ebookmeta.com
IN ACTION
Understanding, analyzing, and generating text with Python

Hobson Lane
Cole Howard
Hannes Max Hapke
Foreword by Dr. Arwen Griffioen

MANNING
Chatbot Recirculating (Recurrent) Pipeline

Response
Text string

4. Execute
Scored Generalize & classify
responses update models
update objective
update dialog plan
select response
Structured
data
(feature Scored
1. Parse 2. Analyze statement 3. Generate
vector)
Tokenizers Check spelling Search
regular expressions check grammar templates
tag analyze sentiment FSM
NER analyze humanness MCMC
extract information analyze style RBM
Response
reduce dimensions CNN RNN
feature
GAN
vector

Database Scored
Statements statements
responses
scroes
user profiles

Possible
responses
Natural Language Processing in Action
ii
Natural Language
Processing in Action
Understanding, analyzing, and generating text with Python

HOBSON LANE
COLE HOWARD
HANNES MAX HAPKE

MANNING
SHELTER ISLAND
For online information and ordering of this and other Manning books, please visit
www.manning.com. The publisher offers discounts on this book when ordered in quantity.
For more information, please contact
Special Sales Department
Manning Publications Co.
20 Baldwin Road
PO Box 761
Shelter Island, NY 11964
Email: [email protected]

©2019 by Manning Publications Co. All rights reserved.

No part of this publication may be reproduced, stored in a retrieval system, or transmitted,


in any form or by means electronic, mechanical, photocopying, or otherwise, without prior
written permission of the publisher.

Many of the designations used by manufacturers and sellers to distinguish their products
are claimed as trademarks. Where those designations appear in the book, and Manning
Publications was aware of a trademark claim, the designations have been printed in initial
caps or all caps.

Recognizing the importance of preserving what has been written, it is Manning’s policy to have
the books we publish printed on acid-free paper, and we exert our best efforts to that end.
Recognizing also our responsibility to conserve the resources of our planet, Manning books
are printed on paper that is at least 15 percent recycled and processed without the use of
elemental chlorine.

Manning Publications Co. Acquisitions editor: Brian Sawyer


20 Baldwin Road Development editor: Karen Miller
PO Box 761 Technical development editor: René van den Berg
Shelter Island, NY 11964 Review editor: Ivan Martinović
Production editor: Anthony Calcara
Copy editor: Darren Meiss
Proofreader: Alyson Brener
Technical proofreader: Davide Cadamuro
Typesetter and cover designer: Marija Tudor

ISBN 9781617294631
Printed in the United States of America
1 2 3 4 5 6 7 8 9 10 – SP – 24 23 22 21 20 19
brief contents
PART 1 WORDY MACHINES .......................................................... 1
1 ■ Packets of thought (NLP overview) 3
2 ■ Build your vocabulary (word tokenization) 30
3 ■ Math with words (TF-IDF vectors) 70
4 ■ Finding meaning in word counts (semantic analysis) 97

PART 2 DEEPER LEARNING (NEURAL NETWORKS) ..................... 153


5 ■ Baby steps with neural networks
(perceptrons and backpropagation) 155
6 ■ Reasoning with word vectors (Word2vec) 181
7 ■ Getting words in order with convolutional
neural networks (CNNs) 218
8 ■ Loopy (recurrent) neural networks (RNNs) 247
9 ■ Improving retention with long short-term memory networks 274
10 ■ Sequence-to-sequence models and attention 311

PART 3 GETTING REAL (REAL-WORLD NLP CHALLENGES) ........ 337


11 ■ Information extraction (named entity extraction and
question answering) 339
12 ■ Getting chatty (dialog engines) 365
13 ■ Scaling up (optimization, parallelization, and
batch processing) 403

v
vi BRIEF CONTENTS
contents
foreword xiii
preface xv
acknowledgments xxi
about this book xxiv
about the authors xxvii
about the cover illustration xxix

PART 1 WORDY MACHINES ........................................... 1

1 Packets of thought (NLP overview)


1.1 Natural language vs. programming language
3
4
1.2 The magic 4
Machines that converse 5 ■
The math 6
1.3 Practical applications 8
1.4 Language through a computer’s “eyes” 9
The language of locks 10 Regular expressions

11
A simple chatbot 12 ■
Another way 16
1.5 A brief overflight of hyperspace 19
1.6 Word order and grammar 21
1.7 A chatbot natural language pipeline 22
1.8 Processing in depth 25
1.9 Natural language IQ 27

vii
viii CONTENTS

2 Build your vocabulary (word tokenization)


2.1 Challenges (a preview of stemming) 32
30

2.2 Building your vocabulary with a tokenizer 33


Dot product 41 Measuring bag-of-words overlap 42

A token improvement 43 Extending your vocabulary with


n-grams 48 Normalizing your vocabulary 54


2.3 Sentiment 62
VADER—A rule-based sentiment analyzer 64 ■
Naive Bayes 65

3 Math with words (TF-IDF vectors)


3.1 Bag of words 71
70

3.2 Vectorizing 76
Vector spaces 79
3.3 Zipf’s Law 83
3.4 Topic modeling 86
Return of Zipf 89 Relevance ranking 90 Tools 93
■ ■

Alternatives 93 Okapi BM25 95 What’s next 95


■ ■

4 Finding meaning in word counts (semantic analysis)


4.1 From word counts to topic scores 98
97

TF-IDF vectors and lemmatization 99 Topic vectors 99 ■

Thought experiment 101 An algorithm for scoring topics 105


An LDA classifier 107


4.2 Latent semantic analysis 111
Your thought experiment made real 113
4.3 Singular value decomposition 116
U—left singular vectors 118 S—singular values 119

VT—right singular vectors 120 SVD matrix orientation



120
Truncating the topics 121
4.4 Principal component analysis 123
PCA on 3D vectors 125 Stop horsing around and get back to

NLP 126 Using PCA for SMS message semantic analysis 128

Using truncated SVD for SMS message semantic analysis 130


How well does LSA work for spam classification? 131
4.5 Latent Dirichlet allocation (LDiA) 134
The LDiA idea 135 LDiA topic model for SMS messages 137

LDiA + LDA = spam classifier 140 A fairer comparison: ■

32 LDiA topics 142


CONTENTS ix

4.6 Distance and similarity 143


4.7 Steering with feedback 146
Linear discriminant analysis 147
4.8 Topic vector power 148
Semantic search 150 ■
Improvements 152

PART 2 DEEPER LEARNING (NEURAL NETWORKS) ...... 153

5 Baby steps with neural networks (perceptrons and


backpropagation) 155
5.1 Neural networks, the ingredient list 156
Perceptron 157 A numerical perceptron 157 Detour
■ ■

through bias 158 Let’s go skiing—the error surface 172


Off the chair lift, onto the slope 173 Let’s shake things up a

bit 174 Keras: neural networks in Python 175 Onward


■ ■

and deepward 179 Normalization: input with style 179


6 Reasoning with word vectors (Word2vec)


6.1 Semantic queries and analogies 182
181

Analogy questions 183


6.2 Word vectors 184
Vector-oriented reasoning 187 How to compute Word2vec

representations 191 How to use the gensim.word2vec


module 200 How to generate your own word vector


representations 202 Word2vec vs. GloVe (Global Vectors) 205


fastText 205 Word2vec vs. LSA 206 Visualizing word


■ ■

relationships 207 Unnatural words 214 Document


■ ■

similarity with Doc2vec 215

7 Getting words in order with convolutional neural networks


(CNNs) 218
7.1 Learning meaning 220
7.2 Toolkit 221
7.3 Convolutional neural nets 222
Building blocks 223 Step size (stride) 224 Filter
■ ■

composition 224 Padding 226 Learning 228


■ ■

7.4 Narrow windows indeed 228


Implementation in Keras: prepping the data 230 Convolutional ■

neural network architecture 235 Pooling 236 ■

Dropout 238 The cherry on the sundae 239 Let’s get to


■ ■
x CONTENTS

learning (training) 241 Using the model in a pipeline



243
Where do you go from here? 244

8 Loopy (recurrent) neural networks (RNNs)


8.1 Remembering with recurrent networks
247
250
Backpropagation through time 255 When do we update ■

what? 257 Recap 259 There’s always a catch 259


■ ■

Recurrent neural net with Keras 260


8.2 Putting things together 264
8.3 Let’s get to learning our past selves 266
8.4 Hyperparameters 267
8.5 Predicting 269
Statefulness 270 ■
Two-way street 271 ■
What is this thing? 272

9 Improving retention with long short-term memory networks


9.1 LSTM 275
274

Backpropagation through time 284 Where does the rubber hit the

road? 287 Dirty data 288 Back to the dirty data 291
■ ■

Words are hard. Letters are easier. 292 My turn to chat 298 ■

My turn to speak more clearly 300 Learned how to say, but


not yet what 308 Other kinds of memory 308 Going


■ ■

deeper 309

10 Sequence-to-sequence models and attention


10.1 Encoder-decoder architecture 312
311

Decoding thought 313 Look familiar? 315 Sequence-to-


■ ■

sequence conversation 316 LSTM review 317


10.2 Assembling a sequence-to-sequence pipeline 318


Preparing your dataset for the sequence-to-sequence training 318
Sequence-to-sequence model in Keras 320 Sequence ■

encoder 320 Thought decoder 322 Assembling the


■ ■

sequence-to-sequence network 323


10.3 Training the sequence-to-sequence network 324
Generate output sequences 325
10.4 Building a chatbot using sequence-to-sequence
networks 326
Preparing the corpus for your training 326 Building your ■

character dictionary 327 Generate one-hot encoded training


sets 328 Train your sequence-to-sequence chatbot 329



CONTENTS xi

Assemble the model for sequence generation 330 Predicting a ■

sequence 330 Generating a response 331 Converse with


■ ■

your chatbot 331


10.5 Enhancements 332
Reduce training complexity with bucketing 332 ■
Paying
attention 333
10.6 In the real world 334

PART 3 GETTING REAL (REAL-WORLD NLP


CHALLENGES) .............................................. 337

11 Information extraction (named entity extraction and question


answering) 339
11.1 Named entities and relations 339
A knowledge base 340 ■
Information extraction 343
11.2 Regular patterns 343
Regular expressions 344 ■
Information extraction as ML feature
extraction 345
11.3 Information worth extracting 346
Extracting GPS locations 347 ■
Extracting dates 347
11.4 Extracting relationships (relations) 352
Part-of-speech (POS) tagging 353 Entity name normalization 357

Relation normalization and extraction 358 Word patterns 358 ■

Segmentation 359 Why won’t split('.!?') work? 360


Sentence segmentation with regular expressions 361


11.5 In the real world 363

12 Getting chatty (dialog engines)


12.1 Language skill 366
365

Modern approaches 367 ■


A hybrid approach 373
12.2 Pattern-matching approach 373
A pattern-matching chatbot with AIML 375 ■
A network view of
pattern matching 381
12.3 Grounding 382
12.4 Retrieval (search) 384
The context challenge 384 Example retrieval-based

chatbot 386 A search-based chatbot 389



xii CONTENTS

12.5 Generative models 391


Chat about NLPIA 392 ■
Pros and cons of each approach 394
12.6 Four-wheel drive 395
The Will to succeed 395
12.7 Design process 396
12.8 Trickery 399
Ask questions with predictable answers 399 Be entertaining 399

When all else fails, search 400 Being popular 400 Be a


■ ■

connector 400 Getting emotional 400


12.9 In the real world 401

13 Scaling up (optimization, parallelization, and batch


processing) 403
13.1 Too much of a good thing (data) 404
13.2 Optimizing NLP algorithms 404
Indexing 405 Advanced indexing 406 Advanced indexing
■ ■

with Annoy 408 Why use approximate indexes at all? 412


An indexing workaround: discretizing 413


13.3 Constant RAM algorithms 414
Gensim 414 ■
Graph computing 415
13.4 Parallelizing your NLP computations 416
Training NLP models on GPUs 416 Renting vs. buying■
417
GPU rental options 418 Tensor processing units 419

13.5 Reducing the memory footprint during model


training 419
13.6 Gaining model insights with TensorBoard 422
How to visualize word embeddings 423

appendix A Your NLP tools 427


appendix B Playful Python and regular expressions 434
appendix C Vectors and matrices (linear algebra fundamentals) 440
appendix D Machine learning tools and techniques 446
appendix E Setting up your AWS GPU 459
appendix F Locality sensitive hashing 473
resources 481
glossary 490

index 497
foreword
I first met Hannes in 2006 when we started different post-graduate degrees in the
same department. He quickly became known for his work leveraging the union of
machine learning and electrical engineering and, in particular, a strong commitment
to having a positive world impact. Throughout his career, this commitment has
guided each company and project he has touched, and it was by following this inter-
nal compass that he connected with Hobson and Cole, who share similar passion for
projects with a strong positive impact.
When approached to write this foreword, it was this passion for the application of
machine learning (ML) for good that persuaded me. My personal journey in machine
learning research was similarly guided by a strong desire to have a positive impact on
the world. My path led me to develop algorithms for multi-resolution modeling eco-
logical data for species distributions in order to optimize conservation and survey
goals. I have since been determined to continue working in areas where I can improve
lives and experiences through the application of machine learning.
With great power comes great responsibility.
—Voltaire?

Whether you attribute these words to Voltaire or Uncle Ben, they hold as true today as
ever, though perhaps in this age we could rephrase to say, “With great access to data
comes great responsibility.” We trust companies with our data in the hope that it is
used to improve our lives. We allow our emails to be scanned to help us compose
more grammatically correct emails; snippets of our daily lives on social media are
studied and used to inject advertisements into our feeds. Our phones and homes
respond to our words, sometimes when we are not even talking to them. Even our

xiii
Other documents randomly have
different content
its administration. To those who know only the trading Jew of our
commercial centres, the modern Sadducees, it reveals a new aspect
of the race—that of the Jew turning aside from all enterprise, content
to live in pious mendicancy, his sole business the observance of the
minutiae of the ceremonial law; the Jew who binds on his phylactery,
wears long ringlets brought down in front of the ears in obedience to
a Levitical precept, and shuns the carrying of a pocket-handkerchief
on the Sabbath, save as a bracelet or a garter. Haluka is a mistake
and a stumbling-block in the path of Zionism. To turn Palestine into a
vast almshouse is not the way to lay the foundation of a Jewish
State. It attracts swarms of slothful bigots whose religion begins and
ends with externals, a salient example of ‘the letter that killeth,’
whose Pharisaic piety has no influence on their conduct in life. It has
established an unproductive population of inefficients, drawn from
the least desirable element of the race. Its evil effect is patent, and
the better sort of Jews themselves condemn it or advise its
restriction to the aged and infirm. It is depressing to move among
crowds of burly men, contributing nothing to the commonweal, puffed
up with self-satisfied bigotry and proud of their useless existence.
Left to his own devices the Jew gives the land a wide berth and
sticks to the town. But Western philanthropy has expended much
money and energy in putting him on to the land, rightly judging that
the foundations of a nation cannot be laid on the hawking of lead-
pencils among the Bedawin who do not want them.
“An agricultural college has been established near Jaffa, but it
was found that the youths availed themselves of the excellent
general education it afforded in order, not to till the land, but to
engage in more congenial and more profitable pursuits. Agricultural
colonies were founded, and the colonists, in addition to free land,
seed, and implements, were endowed by M. Edmund de Rothschild
with 3 francs a day for every man, 2 francs for every woman, and 1
franc for every child. This enabled the recipients to sit down and
employ Arabs to do the work, and has been stopped, to the great
chagrin of the colonists. As a matter of fact, the best of the farms to-
day depend on native labour. The mattock and the hoe are
repugnant to the Jewish colonists, who all seek for places in the
administration. The financial result is not cheering. The most
prosperous concern, perhaps, is the wine-growing establishment of
Rishon le Sion. Wine-making is the one industry the Jews take to.
They practise it individually on a small scale. The Western tourist in
Hebron is invariably accosted by some ringleted Israelite, who
proffers him his ‘guter Wein,’ and his thoughts go back to childhood
and that Brobdingnagian cluster of grapes which the spies bore
between them from the neighbouring valley of Eschol. The attitude of
the Jew with respect to agriculture is not to be wondered at. His
hereditary tendencies are against it. Centuries of urban life and
urban pursuits lie behind him. Inured to no exercise save that of his
wits, poor in physique, unused to the climate, can it be expected that
this child of the ghetto should turn to and compete with the strong
brown-lined Judaean peasant on the burning hillside? The one
exception is to be found in the Bulgarian Jews of Sephardim stock.
Hardy, stalwart, accustomed to tillage, these have made efficient
farmers, and next to them come the Jews from Roumania. But with
every inducement to settle on the land, and all sorts of props and
aids, the agricultural Jews in Palestine number only about 1000 out
318
of an ever-augmenting population. The fact is significant.”
Another point worth serious consideration is the political situation
created by Jewish immigration into Palestine. The colonists, the
majority of whom come from Russia, are a bone of contention
between the rival foreign propagandas in the country. The Russians,
as has been seen, while massacring the Jews in Bessarabia, court
their favour in Syria. The German Emperor, while tolerating anti-
Semitism in the Fatherland, earns the thanks of the Zionists by his
affability towards the exiles. The French, through the educational
efforts of the Alliance Israélite, whose pupils were hitherto mainly
drawn from the Spanish Jews, seek to turn the Jews of Palestine, as
of other parts of the Near East, into apostles of Gallic preponderance
and into instruments for the promotion of Gallic interests. The
Zionists are regarded by the French supporters of the Alliance as its
adversaries, and that for the reason that, while the mission of the
Alliance, as it is understood by the French, is the extension of the
Republic’s influence, and, therefore, very remotely connected with
the religious and national aspirations of the Jewish people, these
aspirations are precisely the point on which the Zionists lay the
319
greatest stress.
Lastly, the poverty of Palestine is a source of infinite difficulties
which can only be overcome by proportionate labour. Mr. Zangwill
has very eloquently described these conditions in one of his
speeches: “My friends,” he said, “you cannot buy Palestine. If you
had a hundred millions you could only buy the place where Palestine
once stood. Palestine itself you must re-create by labour, till it flows
again with milk and honey. The country is a good country. But it
needs a great irrigation scheme. To return there needs no miracle—
already a third of the population are Jews. If the Almighty Himself
carried the rest of us to Palestine by a miracle, what should we gain
except a free passage? In the sweat of our brow we must earn our
Palestine. And, therefore, the day we get Palestine, if the most
320
joyous, will also be the most terrible day of our movement.”
It was the consideration of the various obstacles enumerated
above, and others of a similar nature, coupled with the urgent need
to find a home for those wretched outcasts whose refuge in England
was menaced by the anti-alien agitation, that induced Dr. Herzl, in
321
July 1903, acting on Mr. Chamberlain’s suggestion, to propose
that an agreement should be entered into between the British
Government and the Jewish Colonial Trust for the establishment of a
Jewish settlement in British East Africa. The British Government,
anxious to find a way out of the “Alien Invasion” difficulty, welcomed
the proposal, and Lord Lansdowne expressed his readiness to afford
every facility to the Commission which, it was suggested, should be
sent by the Zionists to East Africa for purposes of investigation. If a
suitable site could be found, the Foreign Secretary professed himself
willing “to entertain favourably proposals for the establishment of a
Jewish colony on conditions which will enable the members to
observe their national customs. For this purpose he would be
prepared to discuss the details of a scheme comprising as its main
features the grant of a considerable area of land, the appointment of
a Jewish official as the chief of the local administration, and
permission to the colony to have a free hand in regard to municipal
legislation, and the management of religious and purely domestic
matters; such local autonomy being conditional on the right of His
322
Majesty’s Government to exercise general control.” This project
was announced at one of the meetings of the Zionist Congress at
Basel in August, 1903, and the motion submitted to the Congress for
the appointment of a committee, who should send an expedition to
East Africa in order to make investigations on the spot, was adopted.
But, though 295 voted in its favour, it was opposed by a great
minority of 177 votes, and the Russian delegates left the hall as a
protest. In a mass meeting of Zionists held in the following May in
London Mr. Israel Zangwill spoke warmly in favour of the proposal,
urging on his fellow-Zionists to take advantage of the offer made by
the British Government. But he added, “The Jewish Colonisation
Association, the one body that should have welcomed this offer of
323
territory with both hands, stood aloof.” Indeed, it cannot be said
that this new departure of Zionism has commanded universal
approval.
Nor did opposition to the scheme confine itself to platonic
protests. In the following December, Dr. Max Nordau, one of the
most distinguished men of letters among Dr. Herzl’s followers, who
had declared himself at the Basel Congress of the previous August
in favour of the proposal, was fired at in Paris by a Russian Jew, who
in his cross-examination before the Magistrate confessed that, in
making that attempt on Dr. Nordau’s life, he aimed at the enemy of
the Jewish race—the supporter of a scheme which involved the
abandonment by Zionists of Palestine as the object of the
324
movement. The incident afforded a painful proof of want of
concord, not only among the Jews generally, not only among the
supporters of various movements all theoretically recognising the
necessity of emigration, but even among the partisans themselves of
the Zionist cause. Dr. Herzl, anxious to allay the ill-feeling aroused
by his alleged abandonment of the Zionist idea, wrote a letter to Sir
Francis Montefiore, the president of the English Zionist Federation,
repudiating any desire to divert the movement away from the Holy
Land and to direct it to East Africa. Nothing, he protested, could be
further from the truth. He felt convinced that the solution of the
Jewish problem could only be effected in that country, Palestine, with
which are indelibly associated the historic and sentimental bias of
the Jewish people. But as the British Government had been
generous enough to offer territory for an autonomous settlement, it
would have been impossible and unreasonable to do otherwise than
325
give the offer careful consideration.
The clouds of misconception of which Dr. Herzl complained were
not dissipated by this declaration. If the attachment to Palestine is to
be the central idea of Zionism, it is hard to see how its realisation
could be promoted by the adoption of East Africa as a home. East
Africa, as a shrewd diplomatist has wittily observed, is not in
Palestine nor on the road to it. Its name awakens no memories or
hopes in the Jewish heart. Its soil is not hallowed by the temples and
the tombs of Israel. Its hills and vales are not haunted by the spirits
of the old martyrs and heroes of the nation. Neither the victories of
the past nor the prophetic visions for the future are in any way
associated with East Africa. In the circumstances, it is not to be
wondered at that the proposal, as Dr. Herzl admitted, did not meet
with the enthusiasm required for success, and that the strongest
opposition to the scheme came from those very Jews in the Russian
“pale” who stand in most need of a refuge from persecution. It must
be borne in mind that those very Jews who suffer most severely from
persecution are the most sincerely and wholeheartedly attached to
the ancient ideals of the race, and, owing partly to this psychological
cause, partly to their less advanced stage of development, they were
the least able to appreciate the practical advantages of the scheme
—the least disposed to submit to the dictates of prosaic expediency.
They firmly believe that, sooner or later, the beautiful dream is
destined to cohere into substance; and, like all dreamers, they abhor
compromise.
The proposal, however, met with opposition in other quarters
than the Russian Ghetto. Sir Charles Eliot, H.M.’s Commissioner for
the East Africa Protectorate, did not approve of it. While disclaiming
all anti-Semitic feeling, he said that his hesitation arose from doubt
as to whether any beneficial result would be obtained from the
scheme. The proposed colony, he pointed out, would not be
sufficiently large to relieve appreciably the congested and suffering
Jewish population of some parts of Eastern Europe, and he
expressed the fear that the climate and agricultural life would in no
way be suitable to Israelites. Moreover, when the country began to
attract British immigrants who showed an inclination to settle all
round the proposed Jewish colony, he considered that the scheme
became dangerous and deprecated its execution. It was, Sir Charles
declared, tantamount to reproducing in East Africa the very
conditions which have caused so much distress in Eastern Europe:
that is to say, the existence of a compact mass of Jews, differing in
language and customs from the surrounding population, to whom
they are likely to be superior in business capacity but inferior in
fighting power. To his mind, it is best to recognise frankly that such
326
conditions can never exist without danger to the public peace.
Sir Harry Johnston also was at first opposed to the scheme, but,
influenced partly by the development of the idea into a less crude
plan, and by the opening up of the country by the Uganda Railway,
partly, perhaps, by the intimate connection between the proposal and
the solution of our own overcrowding problem, he was ultimately
327
converted into a warm supporter of it. Soon afterwards a
Commission was despatched to East Africa to report on the tract of
land offered by the British Government for the proposed Zionist
328
settlement, —a proof that official opposition was abandoned.
But the opposition on the part of the Jews remained, as was
shown by the comments of the Jewish press of America on Mr. Israel
Zangwill’s visit to that country with a view to interesting American
Jews in the project, by his own “absolute and profound disgust” at
their cold irresponsiveness, and even more clearly by the
establishment of the London Zionist League. The President of this
association, Mr. Herbert Bentwich, in his inaugural address,
commenting on the matter, said that the British East Africa scheme
had never touched Zionism in the slightest degree; that it was a
mere accident in Jewish history to which Zionists could not devote
their energies; that the offer of territory had been made as a practical
expression of sympathy “by those who would exclude the alien
immigrant from Great Britain and as such was gratefully to be
received, but it could never be dealt with seriously,” and that the
Zionists hoped not to amend but to end the Jewish distress; that
329
being the object for which the league had been formed in London.
The Commission’s report, published in English and German, was
partly unfavourable and partly inconclusive; but even if it had been
favourable it is doubtful whether it would have met with approval. At
all events, when the scheme was definitely submitted to the Zionist
Congress at Basel, towards the end of July, 1905, it gave rise to
scenes of an unexampled character in the history of Zionism. The
Congress was divided into “Palestinians,” who were opposed to any
Jewish national settlement outside Palestine, and into
“Territorialists,” who maintained that the true aim of Zionism is to
obtain an autonomous settlement anywhere. The latter party, led by
Mr. Zangwill, was strongly in favour of the British offer; the former
was as strongly against it. After a stormy discussion the scheme was
rejected, and a resolution was adopted by an overwhelming majority,
in which the Seventh Zionist Congress reaffirmed the principle of the
creation of a legally secured home for the Jewish people in
Palestine, repudiating, both as object and as means, all colonising
activity outside Palestine, and adjacent lands, and, while thanking
the British Government for its kindness, it expressed the hope that
the latter will continue to aid the Zionists in their efforts to attain their
true aim. Thus this episode in the history of Zionism came to an end.
While the East Africa scheme was the subject of so much
discord both among the Jews and elsewhere, the leader of the
Zionists passed away. Dr. Herzl died at Edlach, in Austria, on the 3rd
of July, 1904, denied the happiness of seeing the mission to which
he had consecrated his life fulfilled. Among his adherents he has left
the reputation of a fervent apostle of emancipation, an inspired
idealist, a Messiah burning with the desire to rescue his people from
persecution and to lead them back to the Land of Promise. But even
those least inclined to follow his lead, could not but admire in him
that single-minded devotion to an ideal and that steadfastness in its
pursuit, which, whether success crowns their possessor or not,
proclaim the great man. Among the masses of his suffering co-
religionists the claims of Dr. Herzl to gratitude are less liable to
qualification. His personality produced a deep impression on their
imagination, and his efforts to realise the dream of eighteen
centuries, aided by the magic of his eloquence and the grace of his
manner, stirred their hearts to their inmost depths. Parents named
their children after Dr. Herzl, and his death aroused universal grief.
Ten thousand mourners, men and women, accompanied the funeral
to the Vienna cemetery, where the remains of the leader were laid to
rest amid the lamentations of his followers. The latter subsequently
gave a tangible proof of their gratitude by providing for their leader’s
orphaned family, and by resolving to perpetuate his memory in a
manner that would have pleased him. The memorial is to take the
form of a forest of ten thousand olive trees planted in some historic
spot in Palestine, and to be known as the Herzl Forest.
It would be rash to affirm that Zionism has died with Dr. Herzl.
Since his death, however, the movement has suffered a certain
transformation. Although his East Africa project has been rejected by
the majority of the party, and though both those who favoured it and
those who opposed it are now persuaded of the hopelessness of a
chartered home in Palestine, yet the plan of a return to the Land of
Promise still is enthusiastically adhered to, especially by the
sufferers of the Russian Ghetto: with the only difference that
repatriation is no longer looked for from the Sultan, or from the
European Powers, but from individual effort. Side by side with
political and diplomatic activity abroad, the Congress of 1905
resolved upon practical work in Palestine itself. This will take the
form of general investigation into the country’s resources and its
economic possibilities, and attempts at amelioration of its
administrative conditions. In other words, the colonisation of
Palestine is to be encouraged and its autonomy postponed until the
Jews are established in sufficient numbers to obtain their ultimate
object. “Creep into Palestine anyway. Colonise, redeem the land,
populate it, establish factories, stimulate trade; in a word, rebuild
Palestine and then see what the Sultan will say.” This is the advice
330
given by a prominent Jew to his co-religionists. Whether these
endeavours will yield the desired fruit or not is a matter on which it
would be more prudent to express an opinion after the event. It is
equally difficult to forecast the outcome of Mr. Zangwill’s “Jewish
Territorial Organisation,” which, abandoning Zion at all events for the
moment, seeks to found a Jewish Colony elsewhere. This variation
of the Zionist programme has attracted the sympathy of many of
those who stood completely aloof from the Herzl scheme. At the
same time it has driven a wedge into Zionism proper.
Meanwhile, it would be idle to deny that, viewed as a whole, the
Jewish Question at the present moment stands pretty much where it
has been at any time during the last eighteen hundred years. A few
Jews have solved the problem for themselves by assimilation to their
surroundings. Some more dwell among the Gentiles in a state of
benevolent neutrality: one with them on the surface, but at heart
distinct; performing all the duties of citizenship conscientiously and
sharing in the intellectual and political life of their adopted countries
brilliantly; yet, by their avoidance of intermarriage, implying the
existence of an insuperable barrier between themselves and those
who have not the good fortune to be descended from Abraham. But
the bulk of the race still is a people of wanderers; and their hope of
restoration little more than a beautiful, melancholy dream. There are
at the present hour upwards of ten million Jews, scattered to the four
corners of the earth. Nine of these millions live in Europe: two-thirds
of them in Russia, Roumania and Poland. In the Middle Ages
persecution in the West had driven them Eastwards. Lately
persecution in the East has turned the tide Westwards. There is no
rest for Israel. If the past and the present are any guides regarding
the future, it is safe to predict that for many centuries to come the
world will continue to witness the unique and mournful spectacle of a
great people roaming to and fro on the highways of the earth in
search of a home.
APPROXIMATE DENSITY OF THE JEWISH POPULATION.
London: Macmillan & Co. Ltd.
FOOTNOTES
1
The oldest Greek author in whose works the term occurs is the
orator Isaeus who flourished b.c. 364; the earliest Latin writer
is Plautus who died b.c. 184. Of course, the word, though very
good Hebrew, may have been imported into Europe by the
Phoenicians. But it would be a bold man who would attempt to
distinguish between Jewish and Phoenician merchants at this
time of day.
2
I. Macc. xiii. 51.
3
On the other hand, a famous Palestinian authority, Abbahu (c.
279–320 a.d.), was a noted friend of Greek. He taught it to his
daughters as “an ornament.” Of Abbahu it was said that he
was the living illustration of Ecclesiastes vii. 18 “It is good that
thou shouldst take hold of this (i.e. the Jewish Law), yet also
from that (i.e. Gentile culture) withdraw not thy hand: for he
that feareth God shall come forth of them all.” Hellenism might
appeal sometimes to the Jew’s head, though it never thrilled
his heart. Cf. p. 39 below.
4
Hdt. i. 1–5.
5
Justin Mart. Dial. i.–vii.
6
I am referring here to what seems to me characteristic of
Hebraism in the earlier periods when it came into contact and
conflict with Hellenism. In its subsequent development
Pharisaism (which gradually absorbed the whole of the Jewish
people) avoided undue asceticism and laid stress on the joy of
living. “Joyous service” became the keynote of Judaism and
Jewish life in the Middle-ages, as it was the keynote of many
Pharisees in the first centuries of the Christian era. The
Essenes, though highly important in the history of primitive
Christianity, had less influence on the main development of
Rabbinic Judaism.
7
Bk. i. ch. vi. 5–7.
8
Mac. xiv.–xv.
9
Pro L. Flacco, 28. All the references made to the Jews and
Judaism in Greek and Latin literature have been well collected
and interpreted by T. Reinach in his Textes d’auteurs grecs et
romains relatifs au Judaisme (Paris, 1895).
10
Suetonius, Julius, 84.
11
Id. Augustus, 93.
12
Suetonius, Tiberius, 36.
13
Tacitus, Historia, v. 9.
14
Suetonius, Claudius, 25. Cp. Acts, xviii. 2.
15
Sat. i. 9, 69, etc.
16
Ant. 18. 3 (4).
17
Sat. v. 184.
18
Fgm. ap. Augustin., Civ. D. 6, 11.
19
Sat. xiv. 96–99, etc.
20
Isaiah iii. 26.
21
Deuter. vii. 3; Nehem. xiii. 25.
22
Juvenal, Sat. xiv. 97.
23
Tacitus, Hist. v. 9.
24
Hist. v. 4.
25
Hist. v. 8.
26
Ib. 5. Cp. Juv. Sat. xiv. 103–4.
27
Annales, xv. 44.
28
Juv. Sat. iii. 12–14.
29
Hist. i. 1.
30
It is, however, only fair to add that the Jewish records know
nothing of these atrocities, and, as M. Reinach justly
comments, the above details (for which Dion Cassius is our
sole authority) “inspirent la méfiance.” The numbers of the
victims, as reported by Dion, are in themselves sufficient to
throw doubt upon the story.
31
H. Graetz, History of the Jews, Eng. tr. vol. ii. p. 405.
32
Mommsen, History of Rome, Eng. tr. vol. iv. p. 642.
33
Just. Mart. Dial. xvii.
34
c Cels. vi. 27.
35
This account of the fervid response of the Jews to Julian’s call,
based on the authority of Christian writers, is pronounced by
the Jewish historian Graetz “purely fictitious” (History of the
Jews, Eng. tr. vol. ii. p. 606). At any rate, it seems to be a
fiction that bears upon it a clearer mark of verisimilitude than
many a “historical” document relating to this period.
36
That the ‘Haman’ so burned was only an effigy is now clearly
shown by an original Geonic Responsum on the subject
discovered in the Cairo Geniza and published in the Jewish
Quarterly Review, xvi. pp. 651 fol.
37
The exact date of the “Tour” is disputed. It probably occupied
the thirteen years between 1160 and 1173.
38
Benjamin of Tudela’s Itinerary, p. 24 (ed. Asher). A new critical
edition (by M. N. Adler) has recently appeared in the Jewish
Quarterly Review. For the passage in the text see ibid. xvi.
730.
39
H. Graetz, History of the Jews, vol. iii. p. 31.
40
H. Graetz, History of the Jews, vol. iii. p. 38.
41
With regard to the legal relations between the Jews and the
various mediaeval states see J. E. Scherer’s Beiträge zur
Geschichte des Judenrechtes im Mittelalter (1901), a work
unhappily left incomplete by the death of the author.
42
Joseph Jacobs, “The God of Israel” in the Nineteenth Century,
September 1879.
43
J. E. Sandys, A History of Classical Scholarship, pp. 539 fol.
44
H. Graetz, History of the Jews, vol. iii. p. 349. For some fine
translations of Jehuda Halevi’s poems the reader may turn to
Mrs. H. Lucas’ The Jewish Year (Macmillan, 1898) and to Mrs.
R. N. Salaman’s Songs of Exile (Macmillan, 1905). Jehuda
Halevi’s philosophical dialogue the Khazari has recently been
translated into English by Dr. H. Hirschfeld (Routledge, 1905).
45
Joseph Jacobs, “The God of Israel,” The Nineteenth Century,
September, 1879. The Guide has been translated into English
by Dr. M. Friedländer (1885; new edition, Routledge, 1904).
46
H. Graetz, History of the Jews, vol. iii. p. 509.
47
For Maimonides see the volume on the subject by D. Yellin and
I. Abrahams in the Jewish Worthies Series, Vol. I. (Macmillan,
1903).
48
Vogelstein and Rieger, Geschichte der Juden in Rom, i, pp.
136 fol. In general this work should be consulted for all points
of contact between the Papacy and Judaism in the middle
ages.
49
Ibn Verga, Shebet Yehuda (ed. Wiener), p. 50.
50
Statutes of Avignon quoted by Israel Abrahams, Jewish Life in
the Middle Ages, p. 408.
51
In the first century of our era Aristo of Pella is said to have
been the author of an attempt to prove from the Prophets that
Jesus was the Messiah. Justin Martyr followed in his path, and
the latter writer’s arguments subsequently reappear in the
works of Tertullian and other Fathers. See W. Trollope’s edition
of S. Justini Dialogus, p. 4.
52
Heine’s famous satire “Disputation” well characterises the
futility of these public controversies; “der Jude wird verbrannt”
was Lessing’s grim summary in Nathan der Weise. See also
Schechter, Studies in Judaism, pp. 125 fol.
53
Lord Curzon, Problems of the Far East, p. 298.
54
Israel Abrahams, Jewish Life in the Middle Ages, p. 407.
55
Lord Curzon, Problems of the Far East, p. 303.
56
Inferno, xi. 49–50.
57
Deuter. xxiii. 19.
58
Ps. xv. 1, 5.
59
Koran (Sale’s tr.) ch. ii.
60
Rep. 555 E.
61
Laws, 742 c.
62
Pol. i. 3, 23.
63
Fifth Homily.
64
We hear, for example, that early in the thirteenth century
interest was fixed by law at 12½ per cent. at Verona, while at
Modena towards the end of the same century it seems to have
been as high as 20 per cent. The Republic of Genoa, a
hundred years later, despite Italy’s commercial prosperity, paid
from 7 to 10 per cent. to her creditors. Much more oppressive
were the conditions of the money market in France and
England. Instances occur of 50 per cent., and there is an edict
of Philip Augustus limiting the Jews in France to 48 per cent. At
the beginning of the fourteenth century an ordinance of Philip
the Fair allows 20 per cent. after the first year of a loan, while
in England under Henry III. there are cases on record of 10 per
cent. for two months.
65
The notorious legend of Hugh of Lincoln is placed by the
chronicler, Matthew Paris, in the year 1255. The prolific nature
of monkish imagination on this subject is shown by the
subjoined facts due to Tyrwhitt’s researches: “In the first four
months of the Acta Sanctorum by Bollandus, I find the
following names of children canonized, as having been
murdered by Jews:

XXV.Mart.Willielmus Norvicensis, 1144;


Richardus, Parisiis, 1179;
XVII.Apr. Rudolphus, Bernae, 1287;
Wernerus, Wesaliae, anno eodem;
Albertus, Poloniae, 1598.

I suppose the remaining eight months would furnish at least


as many more.” Quoted by Dr. W. W. Skeat, Chaucer, Intr., p.
xxiii.
66
A contemporary historian pathetically states that in 1248 “no
foreigner, let alone an Englishman, could look at an English
coin with dry eyes and unbroken heart.” Henry III. issued a
new coin; but it was not long ere it reached the condition of the
older one. In England the penalty for the crime was loss of life
or limbs.
67
W. Cunningham, The Growth of English Industry and
Commerce, p. 187.
68
The original charter of expulsion has recently been discovered;
it was, by a gracious irony of history, found at Leicester at a
time when a Jew had been thrice mayor of the town.
69
See above, p. 98.
70
Alami, quoted by H. Graetz, History of the Jews, vol. iv. p. 220.
71
A History of the Inquisition of Spain, by H. C. Lea (Macmillan,
Vols. I., II. and III. of which have now appeared, 1906), is a
monumental work on its subject.
72
Apologia pro vita sua, p. 29.
73
This attachment of Jews to countries with which they have long
been identified recurs at the present day. Jewish emigration
associations are constantly faced by the reluctance of very
many Russian Jews to tear themselves from Russia.
74
As a matter of fact, Celestine V. hardly deserves this sentence.
It was not cowardice but native humility, the consciousness of
the temptations of power, physical weakness, and the hermit’s
longing for tranquillity that impelled the Pope to resign after five
months and eight days’ pontificate. Commentators had hitherto
agreed in applying the above passage to Celestine V., but
recent opinion rejects the traditional interpretation. However
that may be, the point which concerns us is that Dante
censures a pope.
75
See Berliner, Persönliche Beziehungen zwischen Christen und
Juden. Reference should also be made to the same author’s
Geschichte der Juden in Rom.
76
Paradiso, xii.
77
Praef. ad Librum de Serm. Lat., quoted by Tyrwhitt in Dr. W. W.
Skeat’s Chaucer, Intr., p. xxiii.
78
See above, p. 170.
79
A good account of the Roman Ghetto may be found in E.
Rodocanachi’s Le Saint-Siège et les Juifs: Le Ghetto à Rome
(Paris, 1891).
80
Browning in his Holy-Cross Day has depicted the farcical
grotesqueness of these efforts at conversion as unsparingly as
Heine satirised the compulsory controversies. Cp. above, p. 98
n.
81
Diary, March 23, 1646.
82
I. Abrahams, Jewish Life in the Middle Ages, pp. 409–410.
83
S. Schechter, Studies in Judaism, p. 15.
84
William Hazlitt’s Translation, ch. 857.
85
Ch. 853.
86
Ch. 852.
87
Ch. 700.
88
Ch. 859.
89
Ch. 852.
90
Ch. 864.
91
Ibid.
92
H. Graetz, History of the Jews, vol. iv. p. 502.
93
Ch. 857.
94
Ch. 864.
95
Ch. 866.
96
Ch. 852.
97
Ibid.
98
Ibid.
99
Ibid.
100
Ch. 856.
101
Ch. 861.
102
Ch. 864.
103
Ch. 852.
104
Ch. 855.
105
Ch. 867.
106
Ch. 862.
107
Ch. 858.
108
Ch. 852.
109
Ch. 854.
110
Ch. 860.
111
Ch. 854.
112
Ch. 855.
113
Ch. 854.
114
Ch. 861.
115
Ch. 865.
116
Ch. 869.
117
Ch. 355. O Martin, Martin! What of the “circumcision of the
heart,” to say nothing about Christian charity? But this was in
1541.
118
Ch. 861.
119
Ch. 865.
120
Ch. 866.
121
Von den Juden und Ihren Luegen (1544) is the title of one of
these pamphlets. See H. Graetz, History of the Jews, vol. iv.
pp. 583 fol.
122
For the history of the Hamburg Jews, see M. Grunwald’s
Hamburg’s Deutsche Juden, 1904.
123
On Pfefferkorn and Reuchlin see two papers by S. A. Hirsch in
A Book of Essays (Macmillan, 1905).
124
See above, p. 175.
125
Perhaps the most lucid and impartial estimate of Spinoza’s
place in the world of thought, accessible to the English reader,
is to be found in Sir Frederick Pollock’s Spinoza: His Life and
Philosophy. This work also contains in an appendix a reprint of
the English translation (1706) of the Dutch biography of
Spinoza by his friend the Lutheran minister Johannes Colerus,
published in 1705. The latest biography of Spinoza, based on
new materials, is J. Freudenthal’s Spinoza, sein Leben und
seine Lehre, Erster Band, Das Leben Spinozas (Stuttgart,
1904).
126
Confessio Amantis, bk. vii.
127
See above, p. 199.

You might also like