# US 2016/0063102 A1 · Searching and ranking of code in videos

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2016/0063102 A1
- Document ID: US20160063102A1
- Status: Published application
- Kind: A1
- Application number: 14/834,720
- Filed: 2015-08-25
- Published: 2016-03-03
- Earliest claimed: 2014-08-26
- Assignees: Codota Dot Com Ltd.
- Applicants: Codota Dot Com Ltd.
- Inventors: Eran Yahav
- Web page: https://patentgrep.com/patent/US20160063102A1

## CPC

- G06V 20/48: {Matching video sequences}
- G06F 16/70: of video data
- G06F 40/30: Semantic analysis
- G06V 20/46: {Extracting features or characteristics from the video content, e.g. video fingerprints, representative shots or key frames}
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method comprising: receiving a multiplicity of videos from a source; for each video: receiving meta data related to the video; extracting from the video a video frame containing computer code; identifying a region of interest (ROI) within the video frame; performing OCR of the ROI to extract a code segment; analyzing the code segment by: semantically analyzing the code segment to obtain a first rank, structurally analyzing the code segment to obtain a second rank, and analyzing the meta data to obtain a third rank; and combining the first rank, second rank and third rank into a total rank associated with the code segment; receiving a query; matching the query to each code segment to identify matching code segments and associated videos; and providing the associated videos in accordance with total ranks associated with the matching code segments.

## Claims

### Claim 1

A method for providing a video in response to a query, the method comprising using at least one hardware processor for:
receiving a multiplicity of videos from a source;
for each video:
receiving meta data related to the video;
extracting from the video a video frame containing computer code;
identifying a region of interest (ROI) within the video frame;
performing optical character recognition (OCR) of the ROI to extract a code segment;
analyzing the code segment, said analyzing comprising:
(a) semantically analyzing the code segment to obtain a first rank,
(b) structurally analyzing the code segment to obtain a second rank, and
(c) analyzing the meta data to obtain a third rank; and
combining the first rank, second rank and third rank into a total rank associated with the code segment;
receiving a query;
matching the query to each code segment to identify matching code segments and associated videos; and
providing the associated videos in accordance with total ranks associated with the matching code segments.

### Claim 2 (depends on 1)

The method according to claim 1, further comprising displaying to a user a list of videos from which code segments being associated with highest ranks have been extracted.

### Claim 3 (depends on 1)

The method according to claim 1, further comprising displaying to a user a video from which the code segment has been extracted, wherein the video starts in a frame in which the code segment is displayed.

### Claim 4 (depends on 3)

The method according to claim 3, further comprising displaying to a user a list of additional videos related to a video from which the code segment has been extracted.

### Claim 5 (depends on 1)

The method according to claim 1, wherein performing OCR of the frame comprises using a statistical language model.

### Claim 6 (depends on 5)

The method according to claim 5, wherein the statistical model is associated with a programming language of the code segment.

### Claim 7 (depends on 1)

The method according to claim 1, wherein performing OCR uses results of semantic analysis of the code segment for enhancing results.

### Claim 8 (depends on 1)

The method according to claim 1, wherein semantically analyzing the code segment relates to at least one item selected from the group consisting of: cross-dependencies between the code segment and external code; a part of the code segment relevant to the query; and representatively of the code segment.

### Claim 9 (depends on 1)

The method according to claim 1, wherein structurally analyzing the code segment relates to at least one item selected from the group consisting of: simplicity;
being error-free; and adjustment to coding style or common practice.

### Claim 10 (depends on 1)

The method according to claim 1, wherein analyzing the meta data relates to at least one item selected from the group consisting of: credibility of a user providing the code segment; credibility of a user recommending the code segment; characteristics of code previously viewed by a user searching for the code segment; code recency; code size; code credibility; code usability; upvotes; likes; dislikes; and number of comments.

### Claim 11 (depends on 1)

The method according to claim 1, wherein the first rank, second rank and third rank are combined into a total rank using a weighted average.

### Claim 12 (depends on 1)

The method according to claim 1, wherein identifying a region of interest containing code within the video frame; and performing OCR are performed offline prior to a query being received.

### Claim 13 (depends on 1)

The method according to claim 1, wherein the video frame is a video frame containing an Integrated Development Environment (IDE) screen image, and wherein the ROI is a code containing pane of the IDE.

### Claim 14

A computerized apparatus having a processor and a non-transient memory, the non-transient memory having stored thereon program code for execution by said processor, the program code comprising:
a video receiving component for receiving a multiplicity of videos from a source;
a meta data receiving component for receiving meta data related to each video;
a frame extraction component for extracting from the video a video frame containing computer code;
a frame analysis component for identifying a region of interest (ROI) within the video frame; and
an OCR engine for performing optical character recognition (OCR) of the ROI to extract code segment;
a semantic analysis component for semantically analyzing the code segment to obtain a first rank;
a structural analysis component for structurally analyzing the code segment to obtain a second rank;
a meta data analysis component for analyzing the meta data to obtain a third rank;
a ranking component for combining the first rank, second rank and third rank into a total rank associated with the code segment;
a query receiving component for receiving a query;
a query matching component for matching the query to each code segment to identify matching code segments and associated videos; and
a result providing component for providing the associated videos in accordance with total ranks associated with the matching code segments.

### Claim 15 (depends on 14)

The computerized apparatus according to claim 14, further comprising a user interface for displaying to a user a list of videos from which code segments being associated with highest ranks have been extracted.

### Claim 16 (depends on 15)

The computerized apparatus according to claim 15 wherein the user interface displays to a user a video from which code segment has been extracted, wherein the video starts in a frame in which the code segment is displayed.

### Claim 17 (depends on 15)

The computerized apparatus according to claim 15, wherein the user interface is further adapted to display to a user a list of additional videos related to a video from which the code segment has been extracted.

### Claim 18 (depends on 14)

The computerized apparatus according to claim 14, wherein the OCR engine is adapted to use a statistical language model.

### Claim 19 (depends on 16)

The computerized apparatus according to claim 16, wherein the statistical language model is associated with a programming language of the code segment.

### Claim 20 (depends on 14)

The computerized apparatus according to claim 14, wherein the OCR engine is adapted to use results of semantic analysis of the code segment.

### Claim 21 (depends on 14)

The computerized apparatus according to claim 14, wherein the video frame is a video frame containing an Integrated Development Environment (IDE) screen image, and wherein the ROI is a code containing pane of the IDE.

### Claim 22

A computer program product for providing a video in response to a query, the computer program product comprising a non-transitory computer-readable storage medium having program code embodied therewith, the program code executable by at least one hardware processor to:
receive a video from a source;
receive meta data related to the video;
extract from the video a video frame containing computer code;
identify a region of interest (ROI) within the video frame;
perform optical character recognition (OCR) of the ROI to extract a code segment;
analyze the code segment, comprising:
(a) semantically analyze the code segment to obtain a first rank,
(b) structurally analyze the code segment to obtain a second rank, and
(c) analyze the meta data to obtain a third rank;
combine the first rank, second rank and third rank into a total rank associated with the code segment;
receive a query;
match the query to each code segment to identify matching code segments and associated videos; and
provide the associated videos in accordance with total ranks associated with the matching code segments.
