analysis

Frequency Analysis in Python

给你一囗甜甜゛ 提交于 2019-11-30 05:05:36
I'm trying to use Python to retrieve the dominant frequencies of a live audio input. For the moment I am experimenting using the audio stream my Laptop's built in microphone, but when testing the following code, I am getting very poor results. # Read from Mic Input and find the freq's import pyaudio import numpy as np import bge import wave chunk = 2048 # use a Blackman window window = np.blackman(chunk) # open stream FORMAT = pyaudio.paInt16 CHANNELS = 1 RATE = 1920 p = pyaudio.PyAudio() myStream = p.open(format = FORMAT, channels = CHANNELS, rate = RATE, input = True, frames_per_buffer =

Java text analysis libraries

天大地大妈咪最大 提交于 2019-11-30 03:41:17
I'm looking for a java driven solution to a requirement for analysing sentences to log whether a key word was used positively or negatively. Ie The key word might be 'cabbages' and the sentence:- 'I like cabbages but not peas' And I'd like a java text analyser of some kind to log this as positive. Can the lucene (Hibernate-Search) libraries be utilized to for this? Any thoughts? You're looking for "sentiment analysis". One possibility is LingPipe , who kindly link to their competitors also . Jeff Dalton also has a great list of natural language processing tools in his blog . I doubt there's

Audio analysis to detect human voice, gender, age and emotion — any prior open-source work done?

本秂侑毒 提交于 2019-11-29 19:54:23
Is there prior open-source work done in the field of 'Audio analysis' to detect human-voice (say in spite of some background noise), determine speaker's gender, possibly determine no. of speakers, age of speaker(s), and the emotion of speakers? My hunch is that the speech recognition software like CMU Sphinx could be a good place to start, but if there's something better, it'd be great. I'm a graduate student doing speech recognition research. These are open research problems, and, unfortunately, I'm not aware of open-source packages that can do these things out of the box. If you have some

Algorithms or libraries for textual analysis, specifically: dominant words, phrases across text, and collection of text

无人久伴 提交于 2019-11-29 19:27:59
I'm working on a project where I need to analyze a page of text and collections of pages of text to determine dominant words. I'd like to know if there is a library (prefer c# or java) that will handle the heavy lifting for me. If not, is there an algorithm or multiple that would achieve my goals below. What I want to do is similar to word clouds built from a url or rss feed that you find on the web, except I don't want the visualization. They are used all the time for analyzing the presidential candidate speeches to see what the theme or most used words are. The complication, is that I need

How to suppress code analysis on generated code?

喜欢而已 提交于 2019-11-29 18:14:07
问题 I have a Silverlight project with a generated Reference.cs file where the service reference is in. The class is attributed with [GeneratedCode] and in the project configuration the code analysis on generated code is disabled (Release and Debug). What have I done wrong? 回答1: Maybe you should try the solutions that works for StyleCop: 1) Put ".Designer.cs" to the end of the name of the file you don’t want StyleCop to check. Or call the the class, and the file containing it, "NativeMethods".

Assessing/Improving prediction with linear discriminant analysis or logistic regression

℡╲_俬逩灬. 提交于 2019-11-29 15:18:03
问题 I recently needed to combine two or more variables on some data set to evaluate if their combination could enhance predictivity, thus I made some logistic regression in R. Now, on the statistic Q&A, someone suggested that I may use the linear discriminant analysis. Since I don't have any fitcdiscr.m in MATLAB, I'd rather go with lda in R but I cannot use the fit results to predict AUC or whatever I could use. Indeed, I see that fit output vector of lda in R is some sort of vector with

Java image analysis - counting vertical lines

无人久伴 提交于 2019-11-29 13:55:21
问题 I need a little help on an image analysis algorithm in Java. I basically have images like this: So, as you might guessed, I need to count the lines. What approach do you think would be best? Thanks, Smaug 回答1: A simple segmentation algorithm can help you out. Heres how the algorithm works: scan pixels from left to right and record the position of the first black (whatever the color of your line is) pixel. carry on this process unless you find one whole scan when you don't find the black pixel

Scraping text from file within HTML tags

泄露秘密 提交于 2019-11-29 08:51:36
I have a file that I want to extract dates from, it's a HTML source file so it's full of code and phrases I don't need. I need to extract every instance of a date that's wrapped in a specific HTML tag: abbr title="((this is the text I need))" data-utime=" What's the easiest way to achieve this? Dick Kusleika If you're using Excel VBA, set a reference (Tools - References) to the MSHTML library (entitled Microsoft HTML Object Library in the reference menu) Sub ScrapeDateAbbr() Dim hDoc As MSHTML.HTMLDocument Dim hElem As MSHTML.HTMLGenericElement Dim sFile As String, lFile As Long Dim sHtml As

2^n complexity algorithm

ぃ、小莉子 提交于 2019-11-29 08:42:58
问题 I need to implement and test an algorithm with a 2^n complexity. I have been trying to find one for a while. If there is any way I can acheive this by implementation -- with a exact complexity of 2^n that would be optimal. If anyone knows of a location I can find an example, or could help me implement one, that would be awesome :-). The basic operation can be anything, but a single statment like i++; would be best. 回答1: Generate all subsets of a set with n elements. Added. The simplest way of

Check string indentation?

耗尽温柔 提交于 2019-11-29 07:49:25
I'm building an analyzer for a series of strings. I need to check how much each line is indented (either by tabs or by spaces). Each line is just a string in a text editor. How do I check by how much a string is indented? Or rather, maybe I could check how much whitespace or \t are before a string, but I'm unsure of how. Gizmo To count the number of spaces at the beginning of a string you could do a comparison between the left stripped (whitespace removed) string and the original: a = " indented string" leading_spaces = len(a) - len(a.lstrip()) print(leading_spaces) # >>> 4 Tab indent is