Based on OCR with text analysis technique to the measurement method of attentionTechnical field
The invention belongs to attention fields of measurement, it is directed generally to attention distribution and transfer, tool in research semantic spaceBody is related to measuring attention distribution and the transfer in semantic space based on OCR and text analysis technique.
Background technology
What is attention, it is to be noted that human brain realizes the process occupied by external or inbeing.And attention refers toThe ability that Mr. Yu plants things is directed toward and is concentrated to the psychological activity of people.The founder Michael H.Goldhaber of attention economy are carriedIt arrives, today's society is the abundant society even spread unchecked of an information maximum, relative to superfluous information, the attention resource of peopleIt is rare, with the development of information age, valuable not instead of information, attention.People increasingly focus on the timeManagement, it is desirable to limited attention is placed in more significant things, continued more in the market about the book of time managementThe portable computer software of fast sale, all kinds of time managements emerges one after another, and has great meaning in the information age to the measurement of attentionJustice.
In recent years, scientists develop the measuring technique of attention from many aspects.On the one hand it is to paying attention to energyPower, for example, attention measuring technique is considered that a kind of Cognitive Aptitude Test, the method for Test of attention have note by psychological professionalMeaning power test chart tests table, test exercise etc.;In addition, may be preferably by eyeball itself together with head to the measurement of attentionThe movement in portion is evaluated, and when your eyes stare at certain, your prodigious probability of attention just at this, more as a result, may be usedIt is referred to as attention monitor, such as eye tracker to monitor head and oculomotor wearable device;Attention neuro-physiologyFamily is fed back by studying the brain wave of brain wave variation and human body, is developed brain dateline helmet and is calculated attention.On the other hand, expandNotice that the time scale of process, space scale enter hand measurement note from a series of theme of the concerns generated by attention process, eventMeaning power.For example, attention behavior of Netease's cloud music software by recorder to music, forms unique commending system;Rescue TimeAPP meeting counting users are judged that user has spent respectively and how long opened using the time of App according to classificationHair, design, chat, amusement and other above, user according to statistics can obtain distribution of the attention on APP.Ihour is oneMoney user's typing task, logger task execute the time management software of duration, the thing record that oneself is actively absorbed in by userOn ihour, it is desirable to obtain oneself input degree to everything feelings.The attention of these two aspects measures, and is mankind itself'sAttention training provides a great help with self-management constraint.
Nowadays, big and small electronic equipment can all install a screen, be designed to obtain human attention,And the recovery time of the mankind present 80% or more, all it is to see staring at various screens.Exactly, the content in screenObtain the attention of people.Based on such situation, the present invention is proposed to be measured based on the personal attention of OCR and text analysis techniqueMethod, from larger time and space scale, in conjunction with above-mentioned both sides measurement angle, to existing attention measurement sideFormula is proposed technical perfect and is improved, and is obtained expression of the theme of the person's of being observed concern in semantic space, is finally obtained realityWhen, the distribution of long-term attention, flow regime.
Baidupedia is the world of language meaning to the definition of semantic space.In general, information is meaning and symbolEntity, inherent meaning only pass through certain external form (symbols such as action, expression, word, speech, picture, image)It can just express.Therefore, each symbolism is all the language for conveying meaning, the meaning structure expressed by them in a broad senseAt specific semantic space.Accordingly, the present invention extracts the intrinsic meaning for paying close attention to theme from the angle of external attentionCome, variation of the attention on semantic space is showed by the meaning.
OCR technique (Optical Character Recognition), i.e. optical character identification refer to electronic equipment inspectionThe character printed on paper is looked into, its shape is determined by the pattern for detecting dark, bright, is then translated into shape with character identifying methodThe process of computword.The input of OCR identifying systems is the image of different-format, is exported as computword, purpose is verySimply, it is that image is converted, makes the figure in image continue to preserve, has text of the table then in table in data and imageWord becomes computword without exception, and the enabled storage capacity reduction for reaching image data, the word identified can reuse and divideAnalysis, can also save the manpower inputted by keyboard and time.Current OCR technique comparative maturity, for the recognition accuracy of certificate99% can generally be reached.The Text region accuracy of image quality clearly normal image also can reach 85% or more.Personal visionThe information such as the computer webpage of involved browsing, mobile phone screen, using OCR technique, can easily be converted into computer canThe word of identification extracts expression of the theme in semantic space of the person's of being observed concern.
Text analysis technique, using natural language processing (NLP:Natural Language Processing) and analysisContent of text is converted into data by method, establishes its mathematical model, scientific abstraction is carried out to text, to describe and replaceText.It enables a computer to realize the identification to text by calculating to this model and operation.Text analyzing generally byThree steps form, and parse data, search retrieval, text mining.Text analyzing at present be widely used in customer experience, customer insight,Data analysis etc..From semantic space angle, using text analysis technique, using semantic information as data set, in conjunction withTemporal information, the attention that can obtain each period are mapped in concept in semantic space, obtain attention dwell point withAnd the information such as flowing of attention, attention is indirectly measured to realize.
Invention content
The present invention starts with from external attention and the angle of semantic space, and daily Fixed Time Interval (second/minute) is to being seenElectronic equipment operated by survey person intercepts frame individual's image browsing and converts image to analyzable text using OCR techniqueCollection.Semantic information is extracted from rambling text set using text analysis technique, analysis attention is bonded with the timeSemantic data collection.Meanwhile the present invention will record the number and time that each subprogram is activated, configuration program dataCollection can be obtained from the property of subprogram in relation to personal attention properties macroscopical on spatio-temporal distribution.TwoA data set friendship is mutually echoed, and reflects the distribution characteristics of attention.For example, the sub- journey that everyone activates in some specific timeArrange in order number distribution, learning program and chat program Automobile driving etc..From data set, this method can obtain, attentionIn the mapping of semantic space, the transfer of attention dwell point, attention at any time.According to the personal attention structure generated dailyFeature can accumulate the long-term observation to be formed to personal attention feature, to analyze personal attention knot at workMore long-term attention features such as structure.
The present invention proposes to include the following steps the measurement method of attention based on OCR and text analysis technique:
Step 1. captures visual range
1-1) visual range captured has significant change with the variation for intercepting frequency, and herein, we to locate dailyIt intercepts within 8 hours in working condition, for fixed every 1 minute interception one action picture;
The code of interception personal work picture 1-2) is write, adds up 60 frame pictures of capture per hour, daily accumulative capture 480Frame work picture.
Step 2.OCR technical finesses
The capturing visual handled using OCR technique identifies the word in picture, generates text set;
Step 3. obtains data set
3-1) text set is segmented, removes the processing such as noise generation text set;
3-2) using the participle collection of removal noise, a feature extraction is done to the text of each picture, is extracted crucial semanticInformation records time and semantic information, generative semantics data set;
3-3) obtain the same day activation process of electronic equipment and activationary time and the shut-in time of process, configuration program numberAccording to collection.
Step 4. calculates attention distribution characteristics
It will 4-1) activate program corresponding with label, and calculate the subprogram label distribution activated in certain specific time and numberDistribution;
It 4-2) obtains attention and shifts flow network, record semanteme is at the time of shift and the keyword at the moment, rootAccording to the sequencing of time, generates attention and shift flow network;
Attention residence time 4-3) is calculated, when the time is with where node B where attention shifts the node A in flow networkBetween subtract each other, the residence time of node A can be obtained;Under long-term observation, the situation of change of long-term dwell point in time can be formed;
Focus 4-4) is calculated, the focus of each period daily is recorded, generates the focus curve on the same day, further, in the case where long-time is observed, form long-term focus curve.
Advantageous effect
1, compared to use the methods of eye tracker, psychology test pay attention to cognitive ability.This method mainly measures more wideGeneral attention, measurement is the theme of concern, things distribution in time and transfer case by paying attention to generating.This measurementMethod does not cause radiation to body, is not impacted to personal work, do not limit individual's without dressing heavy mechanical equipmentScope of activities, observation are convenient;
2, compared to Rescue Time, the time managements software such as Ihour, what this method measured is the pass by paying attention to generatingMapping of the theme, things of note on semantic space, rather than the things itself paid close attention to, what is covered can reflect attention featureInformation is more comprehensive, without being manually entered, can realize and automatically record.
3, long-term monitoring is conveniently formed to the Attention behavior for the person of being observed, and skill is measured compared to traditional attentionArt can observe the attention change that some short-term attentional power measurements do not observe.
Description of the drawings
Fig. 1 is attention method flow schematic diagram of the present invention;
Fig. 2 is DBOW model schematics.
Specific implementation mode
Technical scheme of the present invention is described in detail below in conjunction with the accompanying drawings:
The thinking of the present invention is to collect the electronic equipment use information of object being observed, specifically includes program and uses interfaceInformation, handle use information using statistical method and OCR technique, these information indirects illustrate object being observed attentionMapping of the information on semantic space finally obtains the distribution characteristics of attention according to these information.
The basic procedure of the method for the present invention is as shown in Figure 1, specifically include following steps:
Step 1. captures visual range
Module Pillow, Time, selenium timing (for example, one minute) interception that image is handled using Python is seenThe currently used electronic curtain of survey person;Daily observation period is working time, the morning 9:00—12:00, afternoon 13:00-17:00, amount to 8 hours, per hour 60 frame pictures of accumulative capture, daily 480 frames of accumulative capture work picture, by all picturesIt stores to same file under pressing from both sides.Fig. 2 is the work picture example of frame interception.
Step 2.OCR technical finesses
Darg screen is stored, ApiOCR is the API service that Baidu's AI Text regions provide, API
(Application Programming Interface, application programming interface) is that some are pre-definedFunction, it is therefore an objective to application program be provided and be able to access the ability of one group of routine based on certain software or hardware with developer.WeThe use of ApiOCR is one by one text by the On-Screen Identification of interception.Word generation table 2 corresponding with the time in the figure of identification, by table 2Information stored into lexicographic text set in Python.
Table 1 generates text set
Step 3. obtains data set
3-1) the NTLK modules of python is used to carry out subordinate sentence processing first to text set, then carry out word segmentation processing, simultaneouslyFilter out useless information.Such as, count one day within participle word frequency, remove some only minority work pictures in occur it is lowFrequency word;Remove the stop words such as the auxiliary word for not carrying any information, conjunction, except being text set after making an uproar;Stop words is illustrated:{about、above、according、accordingly、across、actually、after、afterwards、again、against,ain't,all};
3-2) the attention object of human brain of the information response in text set, namely meaning object is accounted for, extraction accounts for the semantic letter of meaning objectBreath generative semantics data set is a feature selecting (Feature using the participle collection after denoising to the text of each pictureSelection).Text feature selection, refer to extracting from original feature (all texts) it is a small amount of, it is representativeFeature, but the type of feature does not change, and is originally text lexical set, is still vocabulary after feature extraction, but quantity is bigIt is big to reduce.The keyword that participle is concentrated is extracted by text feature selection, analyzes the attention of worker.Use TF-IDF spiesSelection algorithm is levied, is as follows:
TF-IDF=word frequency (TF) × inverse document frequency (IDF) (3)
The value for calculating the TF-IDF of each word in document, then arranges according to descending, takes several words of front as specialLevy attribute.Here due to before only taking K it is big, the concept of semantic space is mapped in as attention.
Where 3-3) keyword that feature extraction goes out is considered as the attention of author per minute, we term it attentionsPoint similarly counts the participle collection of daily 480 pictures, and using feature extraction keyword, these keywords are attention in languageThe expression of justice spatially;
3-4) (for example, 1 minute) calls process on using windows PowerShell at every fixed timeAPI obtain existing program process, process computer memory occupancy situation.According to time, journey of the statistics computer in observation timeComputer memory occupancy situation when the time span of sort run, distinct program operation, the program number of different time operation.
Step 4. calculates attention distribution characteristics
It 4-1) is concentrated from program data, activation program is corresponding with program tag database, and the class that such as works, is learned amusement classIt is corresponding to practise class, chat class etc., calculates on one day time shaft, certain special time period activates the label distribution of program.It calculatesSubprogram type and the number distribution activated in certain specific time;
Table 2 activates program tag database
| Program | Label |
| Python | Programming, work |
| Wechat (wechat) | Chat |
| R | Programming, work |
| It seeks survival danger spot | Game |
| Tencent's video | Amusement |
| Word | Work |
| …… | …… |
4-2) common property gives birth to 480 participle collection daily, text similarity analysis is done using Doc2vec, if two texts are similarIt spends low, it is believed that attention has occurred transfer and generates attention transfer flow network within this time.Record lime light shiftsAt the time of and the keyword at the moment generate attention and shift flow network according to the sequencing of time.The node of network isLime light, the oriented even side between node A and node B, looks like for the attention force A of last moment, subsequent time is transferred toPay attention to force B;Doc2vec algorithm principles are as follows, obtain
The vector of Sentence/Document indicates that also there are two types of models by Doc2Vec, respectively:Distributed
Memory (DM) and Distributed Bag ofWords (DBOW), DM models given context and document toPredict that the probability of word, DBOW models predict one group of random word in document in the case of given document vector in the case of amountProbability.Here the present invention uses DBOW models, and the input of the model is the vector of document, and prediction is taken out at random in the documentThe word of sample
Attention residence time 4-3) is calculated, time and -1 institute of node i where attention shifts the node i in flow networkSubtract each other in the time, the residence time of node i -1 can be obtained;Under normal conditions, we calculate residence time formula it is as follows,
Focus=top10 { max (time (nodei)-time(nodei-1)) i ∈ (1,2,3 ... n) (4)
Under long-term observation, the situation of change of long-term dwell point in time can be formed;
Focus 4-4) is calculated, the calculation formula of focus is:
(1-n/N) × 100% (5)
Wherein n is the number of network node for each period including, and N is the participle collection number generated each period.For example,The focus of each hour is calculated, N is 60 at this time, if morning 9:00-10:00 produces 10 nodes, then focus is 90%.The focus of record daily each period, generates the focus curve on the same day, further, in the case where long-time is observed, is formed and is grownThe focus curve of phase.